Skip to content

Commit

Permalink
Move cspell-trie to jest
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason3S committed May 23, 2019
1 parent 62049b4 commit c39205e
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 43 deletions.
55 changes: 23 additions & 32 deletions packages/cspell-trie/.vscode/launch.json
Expand Up @@ -13,39 +13,30 @@
"outFiles": []
},
{
"type": "node",
"request": "launch",
"name": "trie: Run Mocha Test Current File",
"program": "${workspaceRoot}/../../node_modules/mocha/bin/_mocha",
"args": [
"--timeout","999999",
"--colors",
"--require", "ts-node/register",
"${file}"
],
"internalConsoleOptions": "openOnSessionStart"
},
"type": "node",
"request": "launch",
"name": "trie: Jest current-file",
"program": "${workspaceFolder}/../../node_modules/.bin/jest",
"args": ["--runInBand", "${file}"],
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"disableOptimisticBPs": true,
"windows": {
"program": "${workspaceFolder}/../../node_modules/jest/bin/jest",
}
},
{
// Name of configuration; appears in the launch configuration drop down menu.
"name": "trie: Run mocha",
// Type of configuration. Possible values: "node", "mono".
"type": "node",
// Request type "launch" or "attach"
"type": "node",
"request": "launch",
// Workspace relative or absolute path to the program.
"program": "${workspaceRoot}/node_modules/mocha/bin/_mocha",
// Automatically stop program after launch.
"stopOnEntry": false,
// Command line arguments passed to the program.
"args": ["--recursive", "dist/**/*.test.js"],
// Workspace relative or absolute path to the working directory of the program being debugged. Default is the current workspace.
"cwd": "${workspaceRoot}",
// Workspace relative or absolute path to the runtime executable to be used. Default is the runtime executable on the PATH.
"runtimeExecutable": null,
"outFiles": [ "${workspaceRoot}/dist/**/*.js" ],
"sourceMaps": true,
// Environment variables passed to the program.
"env": { "NODE_ENV": "test"}
}
"name": "trie: Jest All",
"program": "${workspaceFolder}/../../node_modules/.bin/jest",
"args": ["--runInBand"],
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"disableOptimisticBPs": true,
"windows": {
"program": "${workspaceFolder}/../../node_modules/jest/bin/jest",
}
}
]
}
22 changes: 22 additions & 0 deletions packages/cspell-trie/jest.config.js
@@ -0,0 +1,22 @@
module.exports = {
"browser": false,
"roots": [
"./src"
],
"transform": {
"^.+\\.tsx?$": "ts-jest"
},
"testRegex": "(/__tests__/.*|(\\.|/)(test|spec|perf))\\.tsx?$",
"moduleFileExtensions": [
"ts",
"tsx",
"js",
"jsx",
"json",
"node"
],
"moduleNameMapper": {
"\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$": "<rootDir>/src/__mocks__/fileMock.js",
"\\.(css|less)$": "<rootDir>/src/__mocks__/styleMock.js"
}
}
31 changes: 27 additions & 4 deletions packages/cspell-trie/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 4 additions & 7 deletions packages/cspell-trie/package.json
Expand Up @@ -12,14 +12,11 @@
],
"scripts": {
"clean": "rimraf dist",
"test": "mocha --recursive \"./dist/**/*.test.js\"",
"test-watch": "../../node_modules/.bin/mocha --require ts-node/register --watch --recursive \"src/**/*.test.ts\"",
"build": "tsc -p .",
"clean-build": "npm run clean && npm run build",
"coverage": "NODE_ENV=test nyc --silent --no-clean --temp-dir=../../.nyc_output npm run test-ts",
"test-ts": "NODE_ENV=test ../../node_modules/.bin/mocha --require ts-node/register --recursive \"src/**/*.test.ts\"",
"coverage-coveralls": "nyc report --reporter=text-lcov | coveralls",
"travis-coverage": "npm run coverage && npm run coverage-coveralls",
"coverage": "jest --coverage",
"test-watch": "../../node_modules/.bin/jest --watch",
"test": "jest",
"watch": "tsc -w"
},
"repository": {
Expand Down Expand Up @@ -64,6 +61,6 @@
"node": ">=10.0.0"
},
"devDependencies": {
"@types/mocha": "^5.2.6"
"@types/jest": "^24.0.13"
}
}

0 comments on commit c39205e

Please sign in to comment.