mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 09:46:28 +08:00
core: add unit test for model.user
This commit is contained in:
1 parent
b9fdf3bca9
commit
92229c1ee0
6 files changed
+81
-10
No files matched your search
@@ -1,5 +1,5 @@
|
||||
import 'hydrooj/src/loader';
|
||||
import * as utils from 'hydrooj/dist/utils';
|
||||
import * as utils from 'hydrooj/src/utils';
|
||||
|
||||
describe('Utils', () => {
|
||||
test('Array.isDiff', () => {
|
||||
@@ -70,11 +70,11 @@ describe('Utils', () => {
|
||||
|
||||
test('isClass', () => {
|
||||
const classA = class { };
|
||||
const classB = function () { };
|
||||
classB.prototype.get = function () { return 1 };
|
||||
const funcA = function () { };
|
||||
const classB = function a() { };
|
||||
classB.prototype.get = function a() { return 1; };
|
||||
const funcA = function a() { };
|
||||
expect(utils.isClass(classA)).toBeTruthy();
|
||||
expect(utils.isClass(classB)).toBeTruthy();
|
||||
expect(utils.isClass(funcA)).toBeFalsy();
|
||||
})
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user