Skip to content

Commit

Permalink
Fixed tests in Node v6
Browse files Browse the repository at this point in the history
  • Loading branch information
kevlened committed May 14, 2016
1 parent 1374338 commit 8af5c77
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 17 deletions.
3 changes: 3 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": ["es2015"]
}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ dist
!.npmignore
!.babelrc
!.travis.yml
!.eslintrc.json
compiled_tests
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
src
tests
compiled_tests
coverage
.*
*.log
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
language: node_js
node_js:
- "4"
- "4"
- "6"
21 changes: 10 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,18 @@
"node-dir": "^0.1.10"
},
"scripts": {
"lint": "pragmatist lint",
"watch-lint": "pragmatist watch-lint",
"test": "pragmatist --es5 --type-assertions test",
"watch-test": "pragmatist --es5 --type-assertions watch-test",
"build": "pragmatist --es5 build",
"watch-build": "pragmatist --es5 watch-build"
"lint": "eslint src/ tests/",
"pretest": "npm run lint && npm run build && npm run build:tests",
"test": "mocha compiled_tests/",
"build": "babel src/ --out-dir dist/",
"build:tests": "babel tests/ --out-dir compiled_tests/ && ncp tests/helpers compiled_tests/helpers"
},
"devDependencies": {
"babel-cli": "^6.8.0",
"babel-preset-es2015": "^6.6.0",
"chai": "^3.4.0",
"eslint": "^2.7.0",
"eslint-plugin-jsdoc": "^2.3.1",
"eslint-plugin-lodash": "^1.6.5",
"eslint-plugin-react": "^4.3.0",
"pragmatist": "^3.0.21"
"eslint": "^2.9.0",
"mocha": "^2.4.5",
"ncp": "^2.0.0"
}
}
7 changes: 4 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const getOutputDir = (compiler) => {
return devServer.outputPath;
};

export function CopyWebpackPlugin (patterns = [], options = {}) {
function CopyWebpackPlugin(patterns = [], options = {}) {
if (!_.isArray(patterns)) {
throw new Error('CopyWebpackPlugin: patterns must be an array');
}
Expand Down Expand Up @@ -236,6 +236,7 @@ export function CopyWebpackPlugin (patterns = [], options = {}) {
return {
apply
};
};
}

export default CopyWebpackPlugin;
CopyWebpackPlugin['default'] = CopyWebpackPlugin;
module.exports = CopyWebpackPlugin;
7 changes: 5 additions & 2 deletions tests/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
/* globals describe, it, afterEach, __dirname */
/* globals describe, it, __dirname */
import {
expect
} from 'chai';
import CopyWebpackPlugin from './../src';

// ensure we don't mess up classic imports
const CopyWebpackPlugin = require('./../dist/index');

import fs from 'fs';
import path from 'path';
import _ from 'lodash';
Expand Down

0 comments on commit 8af5c77

Please sign in to comment.