Skip to content

Update test asserts on stubs to use sinon asserts#4205

Merged
moniika merged 3 commits into
RaspberryPiFoundation:developfrom
moniika:regex-assert-cleanup
Aug 21, 2020
Merged

Update test asserts on stubs to use sinon asserts#4205
moniika merged 3 commits into
RaspberryPiFoundation:developfrom
moniika:regex-assert-cleanup

Conversation

@moniika

@moniika moniika commented Aug 20, 2020

Copy link
Copy Markdown
Contributor

The basics

  • I branched from develop
  • My pull request is against develop
  • My code follows the style guide

The details

Resolves

n/a

Proposed Changes

Updates test asserts on stubs to use sinon asserts

Reason for Changes

  • Better assert messages
  • In some cases, clearer intention

Test Coverage

Ran mocha tests

Tested on:

  • Desktop Chrome

Additional Information

Used the following regex to perform cleanup:

Search Replace
chai\.assert\((.+)\.called(Once|Twice|Thrice)\); sinon\.assert\.called$2\($1\);
chai\.assert\.isTrue\((.+)\.called(Once|Twice|Thrice)\); sinon\.assert\.called$2\($1\);
chai\.assert\((.+)\.notCalled\); sinon\.assert\.notCalled\($1\);
chai\.assert\.isTrue\((.+)\.notCalled\); sinon\.assert\.notCalled\($1\); [no occurrences]
chai\.assert\.isFalse\((.+)\.notCalled\); sinon\.assert\.isCalled\($1\); [no occurrences]
chai\.assert\.isFalse\((.+)\.calledOnce\); sinon\.assert\.notCalled\($1\); [separately checked to confirm intention]

@moniika
moniika merged commit b87d449 into RaspberryPiFoundation:develop Aug 21, 2020
@moniika
moniika deleted the regex-assert-cleanup branch August 21, 2020 02:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants