Skip to content

Commit

Permalink
test: fix tests on source code
Browse files Browse the repository at this point in the history
  • Loading branch information
Cweili committed May 18, 2019
1 parent aed8821 commit 18e26b0
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 6 deletions.
18 changes: 17 additions & 1 deletion .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,21 @@
]
}
]
]
],
"env": {
"test": {
"presets": [
[
"@babel/preset-env", {
"loose": true,
"exclude": [
"@babel/plugin-transform-async-to-generator",
"@babel/plugin-transform-regenerator",
"@babel/plugin-transform-typeof-symbol"
]
}
]
]
}
}
}
3 changes: 1 addition & 2 deletions lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ export function isFunction(value) {
const asyncTag = '[object AsyncFunction]';
const funcTag = '[object Function]';
const genTag = '[object GeneratorFunction]';
const proxyTag = '[object Proxy]';
return tag === funcTag || tag === genTag || tag === asyncTag || tag === proxyTag;
return tag === funcTag || tag === genTag || tag === asyncTag;
}

export function each(collection, handler) {
Expand Down
2 changes: 1 addition & 1 deletion test/methods.spec.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import mock from 'xhr-mock';
import ReqJSON from '..';
import ReqJSON from '../index';

describe('req-json middlewares', () => {
const reqJSON = new ReqJSON();
Expand Down
2 changes: 1 addition & 1 deletion test/middlewares.spec.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import mock from 'xhr-mock';
import ReqJSON from '..';
import ReqJSON from '../index';

describe('req-json methods', () => {
beforeEach(() => mock.setup());
Expand Down
2 changes: 1 addition & 1 deletion test/others.spec.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import ReqJSON from '..';
import ReqJSON from '../index';

describe('req-json others', () => {
it('should throw error when call as a function', () => {
Expand Down

0 comments on commit 18e26b0

Please sign in to comment.