Skip to content

Commit 229dace

Browse files
authored
Merge pull request #207 from agraboso/test-lib
Run tests against lib
2 parents bc002db + 2376c09 commit 229dace

File tree

10 files changed

+5972
-5959
lines changed

10 files changed

+5972
-5959
lines changed

.babelrc

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

.size-limit

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
[
22
{
3-
"name": "lib/index.js (min)",
4-
"path": "lib/index.js",
3+
"name": "lib/index.cjs.js (min)",
4+
"path": "lib/index.cjs.js",
55
"limit": "10 KB",
66
"gzip": false
77
},
88
{
9-
"name": "lib/index.js (min + gzip)",
10-
"path": "lib/index.js",
9+
"name": "lib/index.cjs.js (min + gzip)",
10+
"path": "lib/index.cjs.js",
1111
"limit": "4 KB"
1212
},
1313
{
1414
"name": "lib/index.umd.js (min)",
1515
"path": "lib/index.umd.js",
16-
"limit": "10 KB",
16+
"limit": "30 KB",
1717
"gzip": false
1818
},
1919
{
2020
"name": "lib/index.umd.js (min + gzip)",
2121
"path": "lib/index.umd.js",
22-
"limit": "4 KB"
22+
"limit": "12 KB"
2323
}
2424
]

babel.config.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
module.exports = function (api) {
2+
const env = api.cache(() => process.env.NODE_ENV);
3+
4+
const nodeTarget = env === 'test' ? 'current' : '8';
5+
const envModules = env === 'test' ? 'commonjs' : false;
6+
7+
const presets = [
8+
[
9+
"@babel/preset-env", {
10+
modules: envModules,
11+
"useBuiltIns": "usage",
12+
"targets": {
13+
"node": nodeTarget
14+
},
15+
}
16+
]
17+
];
18+
19+
const plugins = [];
20+
21+
return {
22+
presets,
23+
plugins
24+
};
25+
}

jest.config.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
module.exports = {
2+
verbose: !!process.env.CI,
3+
automock: false,
4+
resetMocks: true,
5+
restoreMocks: true,
6+
resetModules: true,
7+
setupFiles: [
8+
"./test/setupJest.js"
9+
],
10+
moduleNameMapper: {
11+
"^redux-api-middleware$": process.env.TEST_LIB ? '..' : './index'
12+
}
13+
};

0 commit comments

Comments
 (0)