Skip to content

Commit 45c3b01

Browse files
committed
Merge pull request Asana#15 from Asana/better-testing
Improving the testing order
2 parents 059ef00 + feaeebc commit 45c3b01

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

README.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,13 @@ The `npm run` supports the following commands.
2424
- **precompile** Automatically run before `compile`. Runs `clean`.
2525
- **compile** Compiles the TypeScript.
2626
- **coveralls** Sends code coverage information to Coveralls.
27-
- **prelint** Automatically run before `lint`. Runs `compile` with `sourceMaps`
28-
this is both for `test` and to make sure any custom lint rules will be
29-
compiled.
3027
- **lint** Runs `tslint` on all of the files.
31-
- **pretest** Automatically run before `test`. Runs `lint` and modifies the
28+
- **pretest** Automatically run before `test`. Compiles and modifies the
3229
compiled JavaScript for sourcemap support and coverage.
3330
- **test** Runs mocha with istanbul code coverage. Set `$MOCHA_REPORTER` to
3431
override which reporter is used in tests.
3532
- **posttest** Automatically run after `test`. Checks the code coverage and will
36-
fail if the code coverage is not sufficient.
33+
fail if the code coverage is not sufficient. Also runs `lint`.
3734
- **typings** Installs the type definitions.
3835

3936
## Contributing

package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,10 @@
1818
"precompile": "npm run clean",
1919
"compile": "find src test typings -name \"*.ts\" | xargs tsc --declaration --module commonjs --target es5 --noImplicitAny --outDir build",
2020
"coveralls": "cat ./coverage/lcov.info | coveralls",
21-
"prelint": "npm run compile -- --sourceMap",
2221
"lint": "find src test -name \"*.ts\" | sed 's/^/--file=/g' | xargs tslint",
23-
"pretest": "npm run lint && find build -type f -name *.js -exec sed -i .bak -e '1s/^var __extends/\\/\\* istanbul ignore next \\*\\/\rvar __extends/; 1s/^/require(\"source-map-support\").install();\r/' {} \\;",
22+
"pretest": "npm run compile -- --sourceMap && find build -type f -name *.js -exec sed -i .bak -e '1s/^var __extends/\\/\\* istanbul ignore next \\*\\/\rvar __extends/; 1s/^/require(\"source-map-support\").install();\r/' {} \\;",
2423
"test": "istanbul cover _mocha -- --reporter ${MOCHA_REPORTER-nyan} --slow 10 --ui tdd --recursive build/**/*_test.js",
25-
"posttest": "istanbul check-coverage --statements 100 --branches 100 --functions 100 --lines 100",
24+
"posttest": "npm run lint && istanbul check-coverage --statements 100 --branches 100 --functions 100 --lines 100",
2625
"typings": "tsd reinstall && tsd rebundle"
2726
},
2827
"repository": {

test/index_test.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,9 @@ suite("Index", () => {
1515
chai.assert.instanceOf(child, index.Parent);
1616
chai.assert.instanceOf(child, index.Child);
1717
});
18+
19+
test.skip("sourcemaps", () => {
20+
// Tests that sourcemaps work
21+
throw new Error("test");
22+
});
1823
});

0 commit comments

Comments
 (0)