Skip to content

Commit

Permalink
gets rid of assertNil() in tests in favor of deepStrictEqual(), given…
Browse files Browse the repository at this point in the history
… that error arrays are now always present
  • Loading branch information
jacoscaz committed Sep 9, 2024
1 parent 94c7cda commit e9c6b7b
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 10 deletions.
4 changes: 0 additions & 4 deletions src/common/utils.test.ts

This file was deleted.

4 changes: 1 addition & 3 deletions src/ocpp16/call.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ import { OCPP16 } from './index.js';
import { describe, it } from 'node:test';
import { deepStrictEqual } from 'node:assert';

import { assertNil } from '../common/utils.test.js';

const { MessageType, Action, validate } = OCPP16;

describe('OCPP16 - Call', () => {
Expand All @@ -28,7 +26,7 @@ describe('OCPP16 - Call', () => {
chargePointModel: 'test',
chargePointVendor: '55',
}]), true);
assertNil(validate.errors);
deepStrictEqual(validate.errors, []);
});

it('invalid notification (missing model)', () => {
Expand Down
4 changes: 1 addition & 3 deletions src/ocpp20/call.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ import { OCPP20 } from './index.js';
import { describe, it } from 'node:test';
import { deepStrictEqual } from 'node:assert';

import { assertNil } from '../common/utils.test.js';

const { MessageType, Action, validate } = OCPP20;

describe('OCPP20 - Call', () => {
Expand Down Expand Up @@ -33,7 +31,7 @@ describe('OCPP20 - Call', () => {
},
reason: 'PowerUp',
}]), true);
assertNil(validate.errors);
deepStrictEqual(validate.errors, []);
});

it('invalid notification (missing model)', () => {
Expand Down

0 comments on commit e9c6b7b

Please sign in to comment.