Skip to content

Commit 15bf956

Browse files
kiritosanzhangh-csjasonsaayman
authored
test: correct relationship between filename and test codes (#6155)
Co-authored-by: zhangh-cs <[email protected]> Co-authored-by: Jay <[email protected]>
1 parent 65a7584 commit 15bf956

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

test/specs/utils/kindOf.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
import {kindOfTest} from '../../../lib/utils';
1+
import utils from '../../../lib/utils';
22

3-
describe('utils::endsWith', function () {
4-
it('should return true if the string ends with passed substring', function () {
5-
const test = kindOfTest('number');
3+
const {kindOf} = utils;
64

7-
expect(test(123)).toEqual(true);
8-
expect(test('123')).toEqual(false);
5+
describe('utils::kindOf', function () {
6+
it('should return object tag', function () {
7+
expect(kindOf({})).toEqual('object');
8+
// cached result
9+
expect(kindOf({})).toEqual('object');
10+
expect(kindOf([])).toEqual('array');
911
});
1012
});

test/specs/utils/kindOfTest.js

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
1-
import utils from '../../../lib/utils';
1+
import {kindOfTest} from '../../../lib/utils';
22

3-
const {kindOf} = utils;
3+
describe('utils::kindOfTest', function () {
4+
it('should return true if the type is matched', function () {
5+
const test = kindOfTest('number');
46

5-
describe('utils::kindOf', function () {
6-
it('should return object tag', function () {
7-
expect(kindOf({})).toEqual('object');
8-
// cached result
9-
expect(kindOf({})).toEqual('object');
10-
expect(kindOf([])).toEqual('array');
7+
expect(test(123)).toEqual(true);
8+
expect(test('123')).toEqual(false);
119
});
1210
});

0 commit comments

Comments
 (0)