mirror of
https://github.com/Choices-js/Choices.git
synced 2024-06-08 00:42:15 +02:00
[Tooling] Transpile tests targeting Node, not browser (#700)
* transplite tests for higher target * fix test * add to lint-stagged too
This commit is contained in:
parent
b48395ce36
commit
1c751472b2
16
.babelrc
16
.babelrc
|
@ -1,3 +1,17 @@
|
|||
{
|
||||
"presets": [["@babel/preset-env", { "loose": true }]]
|
||||
"presets": [["@babel/preset-env", { "loose": true }]],
|
||||
"env": {
|
||||
"test": {
|
||||
"presets": [
|
||||
[
|
||||
"@babel/preset-env",
|
||||
{
|
||||
"targets": {
|
||||
"node": true
|
||||
}
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,5 +10,5 @@ module.exports = {
|
|||
],
|
||||
'.codecov.yml': () =>
|
||||
'curl -f --silent --data-binary @.codecov.yml https://codecov.io/validate',
|
||||
'src/scripts/**/*.js': () => 'mocha',
|
||||
'src/scripts/**/*.js': () => 'npm run test:unit',
|
||||
};
|
||||
|
|
|
@ -8,14 +8,14 @@
|
|||
"start": "run-p js:watch css:watch",
|
||||
"build": "run-p js:build css:build",
|
||||
"lint": "eslint src/scripts",
|
||||
"coverage": "nyc --reporter=lcov --reporter=text --reporter=text-summary mocha",
|
||||
"coverage": "NODE_ENV=test nyc --reporter=lcov --reporter=text --reporter=text-summary mocha",
|
||||
"bundlesize": "bundlesize",
|
||||
"cypress:run": "$(npm bin)/cypress run",
|
||||
"cypress:open": "$(npm bin)/cypress open",
|
||||
"cypress:ci": "cypress run --record --group --ci-build-id $GITHUB_SHA",
|
||||
"test": "run-s test:unit test:e2e",
|
||||
"test:unit": "mocha",
|
||||
"test:unit:watch": "mocha --watch --inspect=5556",
|
||||
"test:unit": "NODE_ENV=test mocha",
|
||||
"test:unit:watch": "NODE_ENV=test mocha --watch --inspect=5556",
|
||||
"test:e2e": "run-p --race start cypress:run",
|
||||
"js:watch": "NODE_ENV=development node server.js",
|
||||
"js:build": "webpack --config webpack.config.prod.js",
|
||||
|
|
|
@ -1331,7 +1331,7 @@ describe('choices', () => {
|
|||
...choices[0],
|
||||
choices,
|
||||
},
|
||||
...choices[1],
|
||||
choices[1],
|
||||
];
|
||||
|
||||
beforeEach(() => {
|
||||
|
|
Loading…
Reference in a new issue