Skip to content

Commit 500939b

Browse files
committed
Improved test scripts (needs less Webpack compiling now)
Signed-off-by: Jaid <jaid.jsx@gmail.com>
1 parent 5f8ea10 commit 500939b

File tree

5 files changed

+37
-18
lines changed

5 files changed

+37
-18
lines changed

package-lock.json

Lines changed: 23 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
"dependencies": {},
1717
"devDependencies": {
1818
"babel-jest": "^24.1.0",
19-
"babel-preset-jaid": "^3.1.0",
19+
"babel-plugin-webpack-alias-7": "^0.1.1",
20+
"babel-preset-jaid": "^3.2.0",
2021
"caniuse-lite": "^1.0.30000938",
2122
"cross-env": "^5.2.0",
2223
"debug": "^4.1.1",
@@ -31,12 +32,13 @@
3132
"scripts": {
3233
"clean": "rimraf dist/ test/**/dist/",
3334
"babel:prod": "rimraf dist/src-transpiled/production && cross-env NODE_ENV=production babel --out-dir dist/src-transpiled/production --source-maps true src",
34-
"babel:dev": "rimraf dist/src-transpiled/production && babel --out-dir dist/src-transpiled/development src",
35+
"babel:dev": "rimraf dist/src-transpiled/development && babel --out-dir dist/src-transpiled/development src",
36+
"babel:test": "rimraf dist/src-transpiled/test && cross-env NODE_ENV=test babel --out-dir dist/src-transpiled/test src",
3537
"build:prod": "cross-env NODE_ENV=production webpack",
3638
"build:dev": "webpack",
37-
"test": "jest && npm run build:prod && cross-env MAIN=dist/package/production jest",
38-
"test:dev": "npm run build:dev && jest",
39-
"test:debug": "cross-env DEBUG=\"$(basename $PWD),$(basename $PWD):*\" node --inspect=9229 node_modules/jest/bin/jest.js --runInBand",
39+
"test": "npm run build:prod && cross-env NODE_ENV=production MAIN=dist/package/production jest --runInBand",
40+
"test:dev": "cross-env NODE_ENV=test jest --runInBand",
41+
"test:debug": "cross-env DEBUG=\"$(basename $PWD),$(basename $PWD):*\" NODE_ENV=test node --inspect=9229 node_modules/jest/bin/jest.js --runInBand",
4042
"release": "npm run clean && npm test && cross-env git tag v$npm_package_version && git push --tags && cross-env opn https://github.com/$npm_package_author_name/$(basename $PWD)/releases/new?tag=v$npm_package_version"
4143
}
4244
}

test/test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import path from "path"
22

3-
const indexModule = (process.env.MAIN ? path.resolve(__dirname, "..", process.env.MAIN) : path.join(__dirname, "..", "src"))
3+
const indexModule = process.env.MAIN ? path.resolve(__dirname, "..", process.env.MAIN) : path.join(__dirname, "..", "src")
44
const {default: arrayToObjectKeys} = require(indexModule)
55

66
it("should run with 1 argument", () => {

webpack.config.babel.js

Lines changed: 0 additions & 6 deletions
This file was deleted.

webpack.config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
const configure = require("webpack-config-jaid").configureNodeLib
2+
3+
module.exports = configure({
4+
documentation: true,
5+
publishimo: {fetchGithub: true},
6+
})

0 commit comments

Comments
 (0)