Skip to content

Commit

Permalink
Setup mocha to use babel
Browse files Browse the repository at this point in the history
  • Loading branch information
german-p committed Dec 14, 2020
1 parent cf52c88 commit 8020303
Show file tree
Hide file tree
Showing 4 changed files with 2,918 additions and 5 deletions.
7 changes: 7 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"presets": [["@babel/preset-env", {
"targets": {
"browsers": ["last 2 Chrome versions"]
}
}]]
}
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@
"files": [
"dist"
],
"sideEffects": false,
"scripts": {
"test": "mocha",
"test": "mocha --require @babel/register",
"prebuild": "npm run build:clean",
"build:clean": "rimraf ./dist",
"build": "rollup -c",
"coverage": "nyc --reporter=text mocha",
"coverage": "nyc --require @babel/register --reporter=text mocha",
"coveralls": "nyc npm test && nyc report --reporter=text-lcov | coveralls",
"lint": "eslint ./src",
"prepublish": "npm run lint && npm run test && npm run build"
Expand All @@ -29,6 +30,7 @@
"devDependencies": {
"@babel/core": "^7.4.5",
"@babel/preset-env": "^7.4.5",
"@babel/register": "^7.12.10",
"chai": "^4.2.0",
"chai-as-promised": "^7.1.1",
"coveralls": "^3.0.3",
Expand All @@ -38,13 +40,13 @@
"mocha": "^6.1.4",
"mocha-lcov-reporter": "^1.3.0",
"nyc": "^14.1.1",
"regenerator-runtime": "^0.13.7",
"rimraf": "^2.6.3",
"rollup": "^1.13.1",
"rollup-plugin-babel": "^4.3.2",
"sinon": "^7.3.2",
"sinon-chai": "^3.3.0"
},
"dependencies": {},
"directories": {
"test": "test"
},
Expand Down
2 changes: 0 additions & 2 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ module.exports = {
plugins: [
babel({
exclude: 'node_modules/**',
babelrc: false,
presets: ['@babel/env'],
}),
],
};

0 comments on commit 8020303

Please sign in to comment.