Skip to content

Commit

Permalink
f
Browse files Browse the repository at this point in the history
  • Loading branch information
fengmk2 committed Jun 4, 2022
1 parent 504c9cf commit 5c8372b
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 17 deletions.
10 changes: 0 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,16 +170,6 @@ egg-bin node-test [files] [options]
- `files` is optional, default to `test/**/*.test.js`
- `test/fixtures`, `test/node_modules` is always exclude.

#### auto require `test/.setup.js`

If `test/.setup.js` file exists, it will be auto require as the first test file.

```js
test
├── .setup.js
└── foo.test.js
```

#### node-test options

- `--test-only` configures the test runner to only execute top level tests that have the only option set
Expand Down
7 changes: 0 additions & 7 deletions lib/cmd/node-test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
const debug = require('debug')('egg-bin');
const fs = require('fs');
const path = require('path');
const globby = require('globby');
const Command = require('../command');
const { getChangedTestFiles, getNodeTestCommandAndArgs } = require('../utils');
Expand Down Expand Up @@ -110,11 +108,6 @@ class NodeTestCommand extends Command {
return;
}

// auto add setup file as the first test file
const setupFile = path.join(process.cwd(), `test/.setup.${testArgv.typescript ? 'ts' : 'js'}`);
if (fs.existsSync(setupFile)) {
files.unshift(setupFile);
}
testArgv._ = files;

// remove alias
Expand Down
1 change: 1 addition & 0 deletions test/fixtures/node-test/test/.setup.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
console.log('setup file will not support on node-test');

0 comments on commit 5c8372b

Please sign in to comment.