Skip to content

Commit

Permalink
Support Babel transpilation in specs
Browse files Browse the repository at this point in the history
  • Loading branch information
piecioshka committed Jun 1, 2019
1 parent 44125a7 commit 2b138c2
Show file tree
Hide file tree
Showing 6 changed files with 198 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .babelrc
@@ -0,0 +1,5 @@
{
"plugins": [
"@babel/plugin-proposal-class-properties"
]
}
2 changes: 1 addition & 1 deletion .mocharc.js
@@ -1,5 +1,5 @@
module.exports = {
require: 'chai',
require: ['chai', '@babel/register'],

// ui: 'bdd',
ui: 'tdd',
Expand Down
2 changes: 2 additions & 0 deletions .vscode/launch.json
Expand Up @@ -10,6 +10,8 @@
"name": "Unit tests",
"program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
"args": [
"--require",
"@babel/register",
"--colors",
"${workspaceFolder}/test/specs/*",
"--sort",
Expand Down
186 changes: 186 additions & 0 deletions package-lock.json

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

3 changes: 3 additions & 0 deletions package.json
Expand Up @@ -18,6 +18,9 @@
},
"dependencies": {},
"devDependencies": {
"@babel/core": "^7.4.5",
"@babel/plugin-proposal-class-properties": "^7.4.4",
"@babel/register": "^7.4.4",
"chai": "^4.2.0",
"coveralls": "^3.0.3",
"mocha": "^6.0.2",
Expand Down
4 changes: 1 addition & 3 deletions src/cart.js
@@ -1,8 +1,6 @@
class Cart {

constructor() {
this.list = [];
}
list = [];

addProduct(product) {
this.list.push(product);
Expand Down

0 comments on commit 2b138c2

Please sign in to comment.