core: add unit test for model.user

This commit is contained in:
undefined committed 2021-04-03 10:35:53 +08:00
1 parent b9fdf3bca9
commit 92229c1ee0
6 files changed
+81 -10

No files matched your search

+5 -5
View File
@@ -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();
})
});
});