Skip to content

Commit 8af5c77

Browse files
committed
Fixed tests in Node v6
1 parent 1374338 commit 8af5c77

File tree

7 files changed

+27
-17
lines changed

7 files changed

+27
-17
lines changed

.babelrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"presets": ["es2015"]
3+
}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,5 @@ dist
77
!.npmignore
88
!.babelrc
99
!.travis.yml
10+
!.eslintrc.json
11+
compiled_tests

.npmignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
src
22
tests
3+
compiled_tests
34
coverage
45
.*
56
*.log

.travis.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
language: node_js
22
node_js:
3-
- "4"
3+
- "4"
4+
- "6"

package.json

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,19 +26,18 @@
2626
"node-dir": "^0.1.10"
2727
},
2828
"scripts": {
29-
"lint": "pragmatist lint",
30-
"watch-lint": "pragmatist watch-lint",
31-
"test": "pragmatist --es5 --type-assertions test",
32-
"watch-test": "pragmatist --es5 --type-assertions watch-test",
33-
"build": "pragmatist --es5 build",
34-
"watch-build": "pragmatist --es5 watch-build"
29+
"lint": "eslint src/ tests/",
30+
"pretest": "npm run lint && npm run build && npm run build:tests",
31+
"test": "mocha compiled_tests/",
32+
"build": "babel src/ --out-dir dist/",
33+
"build:tests": "babel tests/ --out-dir compiled_tests/ && ncp tests/helpers compiled_tests/helpers"
3534
},
3635
"devDependencies": {
36+
"babel-cli": "^6.8.0",
37+
"babel-preset-es2015": "^6.6.0",
3738
"chai": "^3.4.0",
38-
"eslint": "^2.7.0",
39-
"eslint-plugin-jsdoc": "^2.3.1",
40-
"eslint-plugin-lodash": "^1.6.5",
41-
"eslint-plugin-react": "^4.3.0",
42-
"pragmatist": "^3.0.21"
39+
"eslint": "^2.9.0",
40+
"mocha": "^2.4.5",
41+
"ncp": "^2.0.0"
4342
}
4443
}

src/index.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ const getOutputDir = (compiler) => {
3333
return devServer.outputPath;
3434
};
3535

36-
export function CopyWebpackPlugin (patterns = [], options = {}) {
36+
function CopyWebpackPlugin(patterns = [], options = {}) {
3737
if (!_.isArray(patterns)) {
3838
throw new Error('CopyWebpackPlugin: patterns must be an array');
3939
}
@@ -236,6 +236,7 @@ export function CopyWebpackPlugin (patterns = [], options = {}) {
236236
return {
237237
apply
238238
};
239-
};
239+
}
240240

241-
export default CopyWebpackPlugin;
241+
CopyWebpackPlugin['default'] = CopyWebpackPlugin;
242+
module.exports = CopyWebpackPlugin;

tests/index.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1-
/* globals describe, it, afterEach, __dirname */
1+
/* globals describe, it, __dirname */
22
import {
33
expect
44
} from 'chai';
5-
import CopyWebpackPlugin from './../src';
5+
6+
// ensure we don't mess up classic imports
7+
const CopyWebpackPlugin = require('./../dist/index');
8+
69
import fs from 'fs';
710
import path from 'path';
811
import _ from 'lodash';

0 commit comments

Comments
 (0)