Skip to content
This repository was archived by the owner on Mar 17, 2021. It is now read-only.

Commit 52c882e

Browse files
michael-ciniawskyjoshwiens
authored andcommitted
test: standardize test configuration (#214)
1 parent f321874 commit 52c882e

26 files changed

+3606
-1202
lines changed

package-lock.json

Lines changed: 3170 additions & 985 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 20 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -11,30 +11,29 @@
1111
"files": [
1212
"dist"
1313
],
14-
"directories": {
15-
"test": "test"
16-
},
1714
"dependencies": {
1815
"loader-utils": "^1.0.2",
1916
"schema-utils": "^0.3.0"
2017
},
2118
"devDependencies": {
22-
"babel-cli": "^6.24.1",
23-
"babel-jest": "^20.0.3",
24-
"babel-plugin-transform-object-rest-spread": "^6.23.0",
25-
"babel-polyfill": "^6.23.0",
26-
"babel-preset-env": "^1.5.1",
19+
"babel-cli": "^6.0.0",
20+
"babel-jest": "^21.0.0",
21+
"babel-plugin-transform-object-rest-spread": "^6.0.0",
22+
"babel-polyfill": "^6.0.0",
23+
"babel-preset-env": "^1.0.0",
2724
"cross-env": "^5.0.0",
25+
"del": "^3.0.0",
2826
"del-cli": "^1.0.0",
29-
"eslint": "^3.19.0",
30-
"eslint-config-webpack": "^1.2.3",
31-
"eslint-plugin-import": "^2.3.0",
32-
"jest": "^20.0.4",
33-
"lint-staged": "^3.6.0",
34-
"nsp": "^2.6.3",
35-
"pre-commit": "^1.2.2",
27+
"eslint": "^4.0.0",
28+
"eslint-config-webpack": "^1.0.0",
29+
"eslint-plugin-import": "^2.0.0",
30+
"jest": "^21.0.0",
31+
"lint-staged": "^5.0.0",
32+
"memory-fs": "^0.4.0",
33+
"nsp": "^2.0.0",
34+
"pre-commit": "^1.0.0",
3635
"standard-version": "^4.0.0",
37-
"webpack": "^3.6.0",
36+
"webpack": "^3.0.0",
3837
"webpack-defaults": "^1.6.0"
3938
},
4039
"peerDependencies": {
@@ -54,19 +53,14 @@
5453
"test": "jest",
5554
"test:watch": "jest --watch",
5655
"test:coverage": "jest --collectCoverageFrom='src/**/*.js' --coverage",
57-
"travis:coverage": "npm run test:coverage -- --runInBand",
58-
"travis:test": "npm run test -- --runInBand",
5956
"travis:lint": "npm run lint && npm run security",
57+
"travis:test": "npm run test -- --runInBand",
58+
"travis:coverage": "npm run test:coverage -- --runInBand",
6059
"webpack-defaults": "webpack-defaults"
6160
},
62-
"repository": {
63-
"type": "git",
64-
"url": "https://github.com/webpack/file-loader.git"
65-
},
66-
"bugs": {
67-
"url": "https://github.com/webpack/file-loader/issues"
68-
},
69-
"homepage": "https://github.com/webpack/file-loader",
61+
"repository": "https://github.com/webpack/file-loader.git",
62+
"bugs": "https://github.com/webpack/file-loader/issues",
63+
"homepage": "https://webpack.js.org/loaders/file-loader",
7064
"pre-commit": "lint-staged",
7165
"lint-staged": {
7266
"*.js": [

test/Errors.test.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
import loader from '../src';
22

33
describe('Errors', () => {
4-
test('Validation Error', () => {
5-
const err = () => loader.call({
6-
query: { useRelativePath: 1 },
7-
emitFile: true,
8-
});
4+
test('Loader Error', () => {
5+
const err = () => loader.call({ emitFile: false });
96

107
expect(err).toThrow();
118
expect(err).toThrowErrorMatchingSnapshot();
129
});
1310

14-
test('Loader Error', () => {
15-
const err = () => loader.call({ emitFile: false });
11+
test('Validation Error', () => {
12+
const err = () => loader.call({
13+
query: { useRelativePath: 1 },
14+
emitFile: true,
15+
});
1616

1717
expect(err).toThrow();
1818
expect(err).toThrowErrorMatchingSnapshot();
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// Jest Snapshot v1, https://goo.gl/fbAQLP
2+
3+
exports[`Loader Defaults 1`] = `"module.exports = __webpack_public_path__ + \\"9c87cbf3ba33126ffd25ae7f2f6bbafb.png\\";"`;

test/cjs.test.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import fileLoader from '../src';
2-
import cjsFileLoader from '../src/cjs';
1+
import loader from '../src';
2+
import CJSLoader from '../src/cjs';
33

4-
describe('cjs', () => {
4+
describe('CJS', () => {
55
it('should export loader', () => {
6-
expect(cjsFileLoader).toEqual(fileLoader);
6+
expect(CJSLoader).toEqual(loader);
77
});
88

99
it('should export `raw` flag', () => {
10-
expect(cjsFileLoader.raw).toEqual(true);
10+
expect(CJSLoader.raw).toEqual(true);
1111
});
1212
});

test/emitFile.test.js

Lines changed: 0 additions & 30 deletions
This file was deleted.

test/fixtures/emitFile/fixture.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/* eslint-disable */
2+
import svg from '../file.svg';
3+
4+
export default svg

test/fixtures/file.gif

13 KB
Loading

test/fixtures/file.jpg

12.5 KB
Loading

test/fixtures/file.png

6.62 KB
Loading

0 commit comments

Comments
 (0)