How to use the chai.assert.deepEqual function in chai

To help you get started, we’ve selected a few chai examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github AugurProject / augur.js / test / trading / trading.js View on Github external
trade.checkGasLimit(t.trade_ids, t.sender, function (err, trade_ids) {
                    console.log(err);
                    console.log(JSON.stringify(trade_ids, null, 4));
                    assert.deepEqual(err, t.expected.error);
                    assert.deepEqual(trade_ids, t.expected.trade_ids);
                    done();
                });
            });
github bbc / childrens-games-genie / test / core / gmi / stats-values.spec.js View on Github external
it("returns values for the game loaded stat", () => {
            const actualValues = StatsValues.getValues("game_loaded", fakeSettings, fakeVisibleLayer);
            const expectedValues = {
                action_name: "game_loaded",
                action_type: true,
                game_template: "genie",
                game_screen: "visible-layer",
                game_level_name: null,
                settings_status: "audio-true-subtitles-false-motion-true-characterSelected-1-buttonPressed-3",
            };
            assert.deepEqual(actualValues, expectedValues);
        });
github spacesuit-extension / SpaceSuit / integration-test / tests.js View on Github external
async function testSyncCache() {
  let provider = window.web3.currentProvider
  delete window.localStorage.__SpaceSuit_sync_data_cache_eth_accounts
  delete window.localStorage.__SpaceSuit_sync_data_cache_eth_coinbase

  let coinbaseResult = provider.send({id: 1, jsonrpc: '2.0', method: 'eth_coinbase', params: []})
  let accountsResult = provider.send({id: 1, jsonrpc: '2.0', method: 'eth_accounts', params: []})
  assert.deepEqual(accountsResult.result, [])
  assert.isNull(coinbaseResult.result)
  let coinbase = await call('eth_coinbase', [])
  coinbaseResult = provider.send({id: 1, jsonrpc: '2.0', method: 'eth_coinbase', params: []})
  assert.equal(coinbaseResult.result, coinbase)
  accountsResult = provider.send({id: 1, jsonrpc: '2.0', method: 'eth_accounts', params: []})
  assert.equal(accountsResult.result[0], coinbase)

  delete window.localStorage.__SpaceSuit_sync_data_cache_net_version

  let netVersionResult = provider.send({id: 1, jsonrpc: '2.0', method: 'net_version', params: []})
  assert.isNull(netVersionResult.result)
  let netVersion = await call('net_version', [])
  netVersionResult = provider.send({id: 1, jsonrpc: '2.0', method: 'net_version', params: []})
  assert.strictEqual(netVersionResult.result, netVersion)
}
github eduardbcom / lookup-dns-cache / tests / Functional / lookup.js View on Github external
lookup(null, (error, address, family) => {
            assert.strictEqual(error, expectedError);
            assert.deepEqual(address, expectedAddress);
            assert.strictEqual(family, expectedIpFamily);

            done();
        });
    });
github Borewit / music-metadata / test / test-file-riff.ts View on Github external
assert.deepEqual(exif.INAM, ['The Magic Flute'], 'exif.INAM: Display Title');
      assert.deepEqual(exif.IPRD, ['La clemenzo di Tito'], 'exif.IPRD: Product');
      assert.deepEqual(exif.ISBJ, ['An opera in two acts'], 'exif.ISBJ: Subject');
      assert.deepEqual(exif.ISFT, ['Adobe Audition CC 2018.1 (Macintosh)']);
      assert.deepEqual(exif.ISRC, ['Foo Bar'], 'exif.ISRC Source Supplier');
      assert.deepEqual(exif.ITCH, ['Technician'], 'exif.ITCH: Technician');

      const common = metadata.common;
      assert.deepEqual(common.artists, ['Wolfgang Amadeus Mozart']);
      assert.deepEqual(common.title, 'The Magic Flute');
      assert.deepEqual(common.album, 'La clemenzo di Tito');
      assert.deepEqual(common.date, '2018-04-26T13:26:19-05:00');
      assert.deepEqual(common.year, 2018);
      assert.deepEqual(common.encodedby, 'Adobe Audition CC 2018.1 (Macintosh)');
      assert.deepEqual(common.comment, ['Comments here!']);
      assert.deepEqual(common.genre, ['Blues']);
      assert.deepEqual(common.engineer, ['Engineer']);
      assert.deepEqual(common.technician, ['Technician']);
      assert.deepEqual(common.media, 'CD');
    });
github Janpot / microdata-node / test / parser.spec.js View on Github external
it.skip('finds an item with a global id', function () {
    var html =
      '<div>hello</div>';
    var result = parser.toJson(html);
    assert.isArray(result.items);
    assert.lengthOf(result.items, 1);
    assert.deepEqual(result.items[0].id, 'urn:isbn:0-330-34032-8');
  });
github NativeScript / nativescript-cli / test / plugin-prepare.ts View on Github external
{
				name: "tns-core-modules-widgets",
				depth: 0,
				directory: "some dir",
				nativescript: null,
			},
			{
				name: "nativescript-calendar",
				depth: 0,
				directory: "some dir",
				nativescript: null,
			}
		];
		await pluginPrepare.preparePlugins(testDependencies, "android", null, {});
		const prepareData = { "tns-core-modules-widgets": true, "nativescript-calendar": true };
		assert.deepEqual(prepareData, pluginPrepare.preparedDependencies);
	});
});
github AugurProject / augur.js / test / unit / accounts / login.js View on Github external
assertions: function (account) {
      assert.deepEqual(account, errors.BAD_CREDENTIALS);
    },
  });
github cricklet / blue-ot.js / js / helpers / utils.spec.js View on Github external
it ('works', () =&gt; {
    let x: Tree = [1,2,[3,[4]],5,[6],[7,8]]
    assert.deepEqual(
      flatten(x),
      [1,2,3,4,5,6,7,8])
  })
})