Skip to content

Commit

Permalink
Merge pull request #207 from agraboso/test-lib
Browse files Browse the repository at this point in the history
Run tests against lib
  • Loading branch information
nason committed Jul 26, 2018
2 parents bc002db + 2376c09 commit 229dace
Show file tree
Hide file tree
Showing 10 changed files with 5,972 additions and 5,959 deletions.
32 changes: 0 additions & 32 deletions .babelrc

This file was deleted.

12 changes: 6 additions & 6 deletions .size-limit
@@ -1,24 +1,24 @@
[
{
"name": "lib/index.js (min)",
"path": "lib/index.js",
"name": "lib/index.cjs.js (min)",
"path": "lib/index.cjs.js",
"limit": "10 KB",
"gzip": false
},
{
"name": "lib/index.js (min + gzip)",
"path": "lib/index.js",
"name": "lib/index.cjs.js (min + gzip)",
"path": "lib/index.cjs.js",
"limit": "4 KB"
},
{
"name": "lib/index.umd.js (min)",
"path": "lib/index.umd.js",
"limit": "10 KB",
"limit": "30 KB",
"gzip": false
},
{
"name": "lib/index.umd.js (min + gzip)",
"path": "lib/index.umd.js",
"limit": "4 KB"
"limit": "12 KB"
}
]
25 changes: 25 additions & 0 deletions babel.config.js
@@ -0,0 +1,25 @@
module.exports = function (api) {
const env = api.cache(() => process.env.NODE_ENV);

const nodeTarget = env === 'test' ? 'current' : '8';
const envModules = env === 'test' ? 'commonjs' : false;

const presets = [
[
"@babel/preset-env", {
modules: envModules,
"useBuiltIns": "usage",
"targets": {
"node": nodeTarget
},
}
]
];

const plugins = [];

return {
presets,
plugins
};
}
13 changes: 13 additions & 0 deletions jest.config.js
@@ -0,0 +1,13 @@
module.exports = {
verbose: !!process.env.CI,
automock: false,
resetMocks: true,
restoreMocks: true,
resetModules: true,
setupFiles: [
"./test/setupJest.js"
],
moduleNameMapper: {
"^redux-api-middleware$": process.env.TEST_LIB ? '..' : './index'
}
};

0 comments on commit 229dace

Please sign in to comment.