How to use the notDeepStrictEqual function from assert

Find comprehensive JavaScript assert.notDeepStrictEqual code examples handpicked from public code repositorys.

11
12
13
14
15
16
17
18
19
20
    Helpers.convertToFixed(expected, fractionDigits),
    message,
  );
}
assertNotDeepEqualWithTolerance(actual, expected, fractionDigits = 2, message) {
  assert.notDeepStrictEqual(
    Helpers.convertToFixed(actual, fractionDigits),
    Helpers.convertToFixed(expected, fractionDigits),
    message,
  );
fork icon215
star icon308
watch icon0

265
266
267
268
269
270
271
272
273
274
        search: dns.search
    };
    body.Common.myDns.nameServers = ['10.10.10.10'];
    body.Common.myDns.search = ['example.com'];
    assert.notDeepStrictEqual(body.Common.myDns.nameServers, originalDns.nameServers, 'Original and updated nameServers should not match');
    assert.notDeepStrictEqual(body.Common.myDns.search, originalDns.search, 'Original and updated search should not match');
})
.then(() => common.testRequest(
    body,
    `${common.hostname(bigIpAddress, constants.PORT)}${constants.DO_API}`,
fork icon22
star icon51
watch icon21

48
49
50
51
52
53
54
55
56
57
58
  if (!frame) {
    // Show native debug output and the profile for debugging.
    console.log(output.stderr.toString());
    console.log(roots);
  }
  assert.notDeepStrictEqual(frame, undefined);
}


// We need to set --heap-prof-interval to a small enough value to make
// sure we can find our workload in the samples, so we need to set
fork icon0
star icon0
watch icon0

51
52
53
54
55
56
57
58
59
60
61
  return true;
}


{
  const timeoutTraces = traces.filter(filterTimeoutTraces);
  assert.notDeepStrictEqual(timeoutTraces, []);
  const threads = new Set();
  for (const trace of timeoutTraces) {
    threads.add(trace.tid);
  }
fork icon0
star icon0
watch icon0

+ 3 other calls in file

28
29
30
31
32
33
34
35
36
37
38
  }
});


function testUpdateSettingsWith({ server, newServerSettings }) {
  const oldServerSettings = getServerSettings(server);
  assert.notDeepStrictEqual(oldServerSettings, newServerSettings);
  server.updateSettings(newServerSettings);
  const updatedServerSettings = getServerSettings(server);
  assert.deepStrictEqual(updatedServerSettings, { ...oldServerSettings,
                                                  ...newServerSettings });
fork icon0
star icon0
watch icon0

800
801
802
803
804
805
806
807
808
809
810
  AssertionError,
  'deepStrictEqual(new Date(), new Date(2000, 3, 14))'
);


assert.throws(
  () => assert.notDeepStrictEqual(new Date(2000, 3, 14), new Date(2000, 3, 14)),
  {
    name: 'AssertionError',
    message: 'Expected "actual" not to be strictly deep-equal to:\n\n' +
             util.inspect(new Date(2000, 3, 14))
fork icon0
star icon0
watch icon0

+ 3 other calls in file