mirror of
https://github.com/tenrok/axios.git
synced 2026-06-23 20:40:40 +03:00
test: correct relationship between filename and test codes (#6155)
Co-authored-by: zhangh-cs <zhangh-cs@glodon.com> Co-authored-by: Jay <jasonsaayman@gmail.com>
This commit is contained in:
@@ -1,10 +1,12 @@
|
|||||||
import {kindOfTest} from '../../../lib/utils';
|
import utils from '../../../lib/utils';
|
||||||
|
|
||||||
describe('utils::endsWith', function () {
|
const {kindOf} = utils;
|
||||||
it('should return true if the string ends with passed substring', function () {
|
|
||||||
const test = kindOfTest('number');
|
|
||||||
|
|
||||||
expect(test(123)).toEqual(true);
|
describe('utils::kindOf', function () {
|
||||||
expect(test('123')).toEqual(false);
|
it('should return object tag', function () {
|
||||||
|
expect(kindOf({})).toEqual('object');
|
||||||
|
// cached result
|
||||||
|
expect(kindOf({})).toEqual('object');
|
||||||
|
expect(kindOf([])).toEqual('array');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,12 +1,10 @@
|
|||||||
import utils from '../../../lib/utils';
|
import {kindOfTest} from '../../../lib/utils';
|
||||||
|
|
||||||
const {kindOf} = utils;
|
describe('utils::kindOfTest', function () {
|
||||||
|
it('should return true if the type is matched', function () {
|
||||||
|
const test = kindOfTest('number');
|
||||||
|
|
||||||
describe('utils::kindOf', function () {
|
expect(test(123)).toEqual(true);
|
||||||
it('should return object tag', function () {
|
expect(test('123')).toEqual(false);
|
||||||
expect(kindOf({})).toEqual('object');
|
|
||||||
// cached result
|
|
||||||
expect(kindOf({})).toEqual('object');
|
|
||||||
expect(kindOf([])).toEqual('array');
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user