Skip to content

Commit

Permalink
Merge pull request #23 from teadjs/esm
Browse files Browse the repository at this point in the history
Remove esm dependency
  • Loading branch information
okwolf authored Sep 14, 2018
2 parents 915d33f + 7470e23 commit 98beb8c
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 13 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
node_modules
esm
coverage
*.log
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,12 @@ npm test

Here are the available command line arguments:

| Argument | Usage | Default |
|--------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------|
| testPattern | The regex pattern Tead uses to detect test files. Defaults to files ending with `test.js` or `spec.js` not in `node_modules`. | <code>^((?!node_modules).)*(test&#124;spec)\.js$</code> |
| watch | Watch files for changes and rerun tests. Output is limited to only failing tests and overall passing/failing counts. | |
| watchPattern | The regex pattern Tead uses when in watch mode to match which file changes should rereun tests. Defaults to files ending with `.js` not in `node_modules`. | <code>^((?!node_modules).)*\.js$</code> |
| coverage | Test coverage information is collected, reported in the output, and written to the `/coverage` folder. This argument makes use of `npx`, so the same [caveat](#npx) about Node.js versions above applies. Requires a [local install](#local) of Tead. | |
| Argument | Usage | Default |
| ------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------- |
| testPattern | The regex pattern Tead uses to detect test files. Defaults to files ending with `test.js` or `spec.js` not in `node_modules`. | <code>^((?!node_modules).)\*(test&#124;spec)\.js$</code> |
| watch | Watch files for changes and rerun tests. Output is limited to only failing tests and overall passing/failing counts. | |
| watchPattern | The regex pattern Tead uses when in watch mode to match which file changes should rereun tests. Defaults to files ending with `.js` not in `node_modules`. | <code>^((?!node_modules).)\*\.js$</code> |
| coverage | Test coverage information is collected, reported in the output, and written to the `/coverage` folder. This argument makes use of `npx`, so the same [caveat](#npx) about Node.js versions above applies. | |

Each argument is passed in the form `--argument=value`. Here is an example:

Expand Down
11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
{
"name": "tead",
"version": "0.5.0",
"version": "0.5.1",
"description": "Lighting the way to simpler testing",
"files": [
"src"
"src",
"esm"
],
"main": "./src/index.js",
"bin": {
Expand All @@ -12,14 +13,14 @@
"engines": {
"node": ">=6.0"
},
"dependencies": {
"devDependencies": {
"esm": "=3.0.72"
},
"scripts": {
"clean": "npx rimraf coverage node_modules",
"clean": "npx rimraf node_modules esm coverage",
"format": "npx prettier --write {src,test}/**/*.js",
"format:check": "npx prettier --list-different {src,test}/**/*.js",
"pretest": "node test/bootstrap",
"pretest": "npx rimraf esm && npx cp -r node_modules/esm . && node test/bootstrap",
"test": "node src/tead.js --coverage",
"test:watch": "node src/tead.js --watch",
"prepare": "npm run format:check && npm t",
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ module.exports = options => {
} = options;
if (coverage) {
spawn(
`npx nyc --require esm --temp-directory coverage -r lcov -r text node ${__dirname}/tead.js "--testPattern=${testPattern}"`,
`npx nyc --require ${__dirname}/../esm/esm.js --temp-directory coverage -r lcov -r text node ${__dirname}/tead.js "--testPattern=${testPattern}"`,
{
shell: true,
stdio: "inherit"
Expand Down
2 changes: 1 addition & 1 deletion src/tead.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env node

const options = require("./options")();
require = require("esm")(module);
require = require("../esm/esm")(module);

require("./")(options);

0 comments on commit 98beb8c

Please sign in to comment.