当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript assert.notStrictEqual方法代码示例

本文整理汇总了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);
    });
开发者ID:bruce,项目名称:apollo-client,代码行数:35,代码来源:diffAgainstStore.ts

示例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]);
    });
开发者ID:hammadj,项目名称:apollo-client,代码行数:56,代码来源:diffAgainstStore.ts

示例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);
 });
开发者ID:agaricus,项目名称:ear-sharpener,代码行数:11,代码来源:test.ts

示例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);
  });
开发者ID:disco-network,项目名称:odata-rdf-interface,代码行数:7,代码来源:sparql_mappings_spec.ts

示例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');
		});
开发者ID:AbraaoAlves,项目名称:tsd,代码行数:8,代码来源:hash.ts


注:本文中的chai.assert.notStrictEqual方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。