本文整理汇总了TypeScript中chai.assert.notStrictEqual方法的典型用法代码示例。如果您正苦于以下问题:TypeScript assert.notStrictEqual方法的具体用法?TypeScript assert.notStrictEqual怎么用?TypeScript assert.notStrictEqual使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类chai.assert
的用法示例。
在下文中一共展示了assert.notStrictEqual方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: it
it('will return the same JSON scalar field object', () => {
const query = gql`
{
a { b c }
d { e f }
}
`;
const queryResult = {
a: { b: 1, c: { x: 2, y: 3, z: 4 } },
d: { e: 5, f: { x: 6, y: 7, z: 8 } },
};
const store = writeQueryToStore({
query,
result: queryResult,
});
const previousResult = {
a: { b: 1, c: { x: 2, y: 3, z: 4 } },
d: { e: 50, f: { x: 6, y: 7, z: 8 } },
};
const { result } = diffQueryAgainstStore({
store,
query,
previousResult,
});
assert.deepEqual(result, queryResult);
assert.notStrictEqual(result, previousResult);
assert.strictEqual(result.a, previousResult.a);
assert.notStrictEqual(result.d, previousResult.d);
assert.strictEqual(result.d.f, previousResult.d.f);
});
示例2: it
it('will return parts of the previous result if there are changes in child arrays', () => {
const query = gql`
query {
a {
b
}
c {
d
e {
f
}
}
}
`;
const queryResult = {
a: [{ b: 1.1 }, { b: 1.2 }, { b: 1.3 }],
c: {
d: 2,
e: [{ f: 3.1 }, { f: 3.2 }, { f: 3.3 }, { f: 3.4 }, { f: 3.5 }],
},
};
const store = writeQueryToStore({
query,
result: queryResult,
});
const previousResult = {
a: [{ b: 1.1 }, { b: -1.2 }, { b: 1.3 }],
c: {
d: 20,
e: [{ f: 3.1 }, { f: 3.2 }, { f: 3.3 }, { f: 3.4 }, { f: 3.5 }],
},
};
const { result } = diffQueryAgainstStore({
store,
query,
previousResult,
});
assert.deepEqual(result, queryResult);
assert.notStrictEqual(result, previousResult);
assert.notStrictEqual(result.a, previousResult.a);
assert.strictEqual(result.a[0], previousResult.a[0]);
assert.notStrictEqual(result.a[1], previousResult.a[1]);
assert.strictEqual(result.a[2], previousResult.a[2]);
assert.notStrictEqual(result.c, previousResult.c);
assert.notStrictEqual(result.c.e, previousResult.c.e);
assert.strictEqual(result.c.e[0], previousResult.c.e[0]);
assert.strictEqual(result.c.e[1], previousResult.c.e[1]);
assert.strictEqual(result.c.e[2], previousResult.c.e[2]);
assert.strictEqual(result.c.e[3], previousResult.c.e[3]);
assert.strictEqual(result.c.e[4], previousResult.c.e[4]);
});
示例3: it
it('should set the level and step for a game', () => {
const game = createAndInitGame();
const newLevel = 2;
const newStep = 2;
assert.notStrictEqual(game.level, newLevel);
assert.notStrictEqual(game.step, newStep);
const updatedGame = setDifficulty(game, newLevel, newStep);
assert.strictEqual(updatedGame.level, newLevel);
assert.strictEqual(updatedGame.step, newStep);
assert.strictEqual(updatedGame.shouldRefreshChoices, true);
});
示例4: it
it("should always return a different variable name for different entries", function() {
let mapping = helper.createUnstructuredMapping();
let a = mapping.getPropertyVariable("A");
let b = mapping.getPropertyVariable("B");
assert.notStrictEqual(a, b);
});
示例5: it
it('should serialise Date, include millisecond level', () => {
var valueA = new Date();
var ori = xm.jsonToIdent(valueA);
var alt = xm.jsonToIdent(new Date(valueA.getTime()));
assert.strictEqual(ori, alt, 'identical values');
alt = xm.jsonToIdent(new Date(valueA.getTime() + 2));
assert.notStrictEqual(ori, alt, 'milli second');
});