-
-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Javascript test line numbers #74
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
{ | ||
// Use IntelliSense to learn about possible attributes. | ||
// Hover to view descriptions of existing attributes. | ||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"type": "node", | ||
"request": "launch", | ||
"name": "Mocha Current Spec File", | ||
"skipFiles": [ | ||
"<node_internals>/**" | ||
], | ||
"program": "${workspaceFolder}/node_modules/.bin/mochapack", | ||
"args": [ | ||
"--webpack-config", "config/webpack/test.js", | ||
"--require", "spec/javascript/setup.js", | ||
"--timeout", "999999", | ||
"--colors", | ||
"${file}" | ||
], | ||
"console": "integratedTerminal", | ||
"internalConsoleOptions": "neverOpen" | ||
}, | ||
{ | ||
"type": "node", | ||
"request": "launch", | ||
"name": "Mocha All JS Specs", | ||
"skipFiles": [ | ||
"<node_internals>/**" | ||
], | ||
"program": "${workspaceFolder}/node_modules/.bin/mochapack", | ||
"args": [ | ||
"--webpack-config", "config/webpack/test.js", | ||
"--require", "spec/javascript/setup.js", | ||
"--timeout", "999999", | ||
"--colors", | ||
"spec/javascript/**/*.spec.js" | ||
], | ||
"console": "integratedTerminal", | ||
"internalConsoleOptions": "neverOpen" | ||
} | ||
] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,8 +12,16 @@ process.env.NODE_ENV = process.env.NODE_ENV || 'test' | |
process.env.RAILS_ENV = process.env.RAILS_ENV || 'test' | ||
|
||
const environment = require('./environment') | ||
const nodeExternals = require('webpack-node-externals'); | ||
|
||
const babelLoader = environment.loaders.get('babel') | ||
babelLoader.include.push(babelLoader.include[0].concat('../../test')) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This doesn't seem to be necessary anymore 🤷 |
||
environment.config.merge({ | ||
output: { | ||
devtoolModuleFilenameTemplate: '[absolute-resource-path]', | ||
devtoolFallbackModuleFilenameTemplate: '[absolute-resource-path]?[hash]' | ||
}, | ||
mode: 'development', | ||
externals: [nodeExternals()], | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On my machine, this line sped up compilation time from 2.51s to 1.38s. Though I think it was closer to 0.84s as of a day or two ago (before adding source maps) |
||
devtool: 'inline-cheap-module-source-map' | ||
}) | ||
|
||
module.exports = environment.toWebpackConfig() |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,9 +22,10 @@ | |
"mocha-junit-reporter": "^1.23.3", | ||
"mochapack": "^1.1.15", | ||
"webpack-cli": "^3.3.11", | ||
"webpack-dev-server": "^3.10.3" | ||
"webpack-dev-server": "^3.10.3", | ||
"webpack-node-externals": "^1.7.2" | ||
}, | ||
"scripts": { | ||
"test": "mochapack --webpack-config config/webpack/test.js --require test/setup.js test/**/*.spec.js" | ||
"test": "mochapack --webpack-config config/webpack/test.js --require spec/javascript/setup.js --colors 'spec/javascript/**/*.spec.js'" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Without the quotes around the glob pattern, it's possible for some wonky shell interpolation to kick in instead of letting mocha handle it |
||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am looking forward to sysgears/mochapack#63 being resolved so that this file can reference a script in package.json instead of the args here potentially getting out of sync