Skip to content

Commit

Permalink
run tests without ts-node in order to speed up the build
Browse files Browse the repository at this point in the history
Signed-off-by: Anton Kosyakov <anton.kosyakov@typefox.io>
  • Loading branch information
akosyakov committed Jan 22, 2019
1 parent 9f6179b commit dcb7757
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 11 deletions.
4 changes: 2 additions & 2 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,11 @@
"name": "Run Mocha Test",
"program": "${workspaceRoot}/node_modules/mocha/bin/_mocha",
"args": [
"${file}",
"--no-timeouts",
"--colors",
"--opts",
"${workspaceRoot}/configs/mocha.opts"
"${workspaceRoot}/configs/mocha.opts",
"**/${fileBasenameNoExtension}.js"
],
"env": {
"TS_NODE_PROJECT": "${workspaceRoot}/tsconfig.json"
Expand Down
3 changes: 1 addition & 2 deletions configs/mocha.opts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
--require ignore-styles
--require monaco-languageclient/lib/register-vscode
--require ts-node/register
--require reflect-metadata/Reflect
--reporter spec
--watch-extensions ts
--watch-extensions js
4 changes: 2 additions & 2 deletions dev-packages/ext-scripts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
"ext:watch": "tsc -w -p compile.tsconfig.json",
"ext:docs": "typedoc --tsconfig ../../configs/typedoc-tsconfig.json --options ../../configs/typedoc.json src",
"ext:docs:clean": "rimraf docs/api",
"ext:test": "nyc mocha --opts ../../configs/mocha.opts \"./src/**/*.*spec.ts\"",
"ext:test:watch": "mocha -w --opts ../../configs/mocha.opts \"./src/**/*.*spec.ts\"",
"ext:test": "nyc mocha --opts ../../configs/mocha.opts \"./lib/**/*.*spec.js\"",
"ext:test:watch": "mocha -w --opts ../../configs/mocha.opts \"./lib/**/*.*spec.js\"",
"ext:test:clean": "rimraf .nyc_output && rimraf coverage"
}
}
3 changes: 3 additions & 0 deletions doc/Testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## Running tests

Before running make sure to compile tests with `compile` or `watch` scripts.

To run tests on theia run:

`yarn test`
Expand All @@ -12,6 +14,7 @@ If you want to run all tests for a particular Theia extension, execute the follo

`npx run test @theia/extension-name`


Add the following npm script to the `package.json` of the desired Theia extension, if you would like to enable the watch mode for the tests.

```json
Expand Down
5 changes: 1 addition & 4 deletions packages/keymaps/compile.tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,5 @@
},
"include": [
"src"
],
"exclude": [
"**/*.spec.ts"
]
}
}
2 changes: 1 addition & 1 deletion packages/process/src/node/raw-process.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const track = temp.track();
*/

const expect = chai.expect;
const FORK_TEST_FILE = path.join(__dirname, 'test', 'process-fork-test.js');
const FORK_TEST_FILE = path.join(__dirname, '../../src/node/test/process-fork-test.js');

describe('RawProcess', function () {

Expand Down

0 comments on commit dcb7757

Please sign in to comment.