本文整理汇总了TypeScript中chai.assert.notDeepEqual方法的典型用法代码示例。如果您正苦于以下问题:TypeScript assert.notDeepEqual方法的具体用法?TypeScript assert.notDeepEqual怎么用?TypeScript assert.notDeepEqual使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类chai.assert
的用法示例。
在下文中一共展示了assert.notDeepEqual方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: it
it('should apply options', () => {
let appliedOptions = getRepository().applyOptions(getRepository().getQueryBuilder(), {
select: 'name',
});
assert.notDeepEqual(appliedOptions, getRepository().getQueryBuilder());
});
示例2: it
it('should remove the item from the array', () => {
let removedValue = dummy.values[1];
let lastValue = dummy.values[2];
dummy.remove(removedValue);
assert.lengthOf(dummy.values, 2, 'dummy.values should now be 2 items');
assert.notDeepEqual(dummy.values[1], removedValue, 'value[1] should now be a different value after remove');
assert.deepEqual(dummy.values[1], lastValue, 'value[1] should now be equal to the last value');
});
示例3: it
it('should shuffle an array', () => {
const arr = [1, 2, 3, 4, 5, 6];
let arrCopy = [...arr];
shuffleArray(arrCopy);
assert.notDeepEqual(arr, arrCopy);
assert.deepEqual(arr, arrCopy.sort());
});
示例4: it
it("returns proper result when async", () => {
const promise = testInstance.testAsyncMehtod(expectedResult);
assert.notDeepEqual(promise.then, undefined);
return promise.then((actualResult: any) => {
assert.deepEqual(actualResult, expectedResult);
});
});
示例5: it
it("should return correct value from json file if found in client json before common json", () => {
const commonJsonContents = {
KEY: "Value"
},
clientJsonContents = {
KEY: "Overriden value"
},
pathToDefaultMessageJson = join(__dirname, "..", "..", "resources", "messages", "errorMessages.json"),
injector = createTestInjector({});
injector.register("fs", {
exists: (path: string): boolean => true,
readJson: (filename: string, encoding?: string): any => filename === pathToDefaultMessageJson ? commonJsonContents : clientJsonContents
});
service = injector.resolve("$messagesService");
service.pathsToMessageJsonFiles = ["clientJsonFile.json"];
assert.notDeepEqual(commonJsonContents.KEY, service.getMessage("KEY"), "Messages service should return correct value from json file when value is overriden by client.");
assert.deepEqual(clientJsonContents.KEY, service.getMessage("KEY"), "Messages service should return correct value from json file when value is overriden by client.");
});
示例6: it
it('should successfully override nested enum config without changing the default', () => {
assert.deepEqual(extendedOpt.enum.binProps.maxbins, [100,200]);
assert.notDeepEqual(extendedOpt.enum.binProps.maxbins, DEFAULT_QUERY_CONFIG.enum.binProps.maxbins);
});