Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tests #80

Merged
merged 2 commits into from
Jul 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Test

on: [push]
on: [push, pull_request]

jobs:
unit-tests:
Expand Down
14 changes: 7 additions & 7 deletions src/spec/assertion/arraysToBeEqual.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,22 @@ export class ExpectArraysToBeEqualTestSuite {
@TestCase(`'a, b, c' and 'a, b, c'`, ['a', 'b', 'c'], ['a', 'b', 'c'])
@TestCase(`empty arrays`, [], [])
@TestCase(`arrays with undefined values`, [undefined, undefined], [undefined, undefined])
private equal(actual, expected) {
public equal(actual, expected) {
expect.arraysToBeEqual(actual, expected);
}

@Test('ReadonlyArrays to be equal')
private equal() {
const actual: ReaonlyArray<string> = ['a', 'b', 'c'];
const expected: ReaonlyArray<string> = ['a', 'b', 'c'];
public equalReadonly() {
const actual: readonly string[] = ['a', 'b', 'c'];
const expected: readonly string[] = ['a', 'b', 'c'];
expect.arraysToBeEqual(actual, expected);
}
}

@Test('Arrays to be equal, should fail')
@TestCase(`'a, b, c' to equal 'b, c, a'`, ['a', 'b', 'c'], ['b', 'c', 'a'])
@TestCase(`different lengths`, ['a', 'b', 'c', 'd'], ['a', 'b', 'c'])
@TestCase(`different lengths, but the other way around`, ['a', 'b', 'c'], ['a', 'b', 'c', 'd'])
private unequal(actual, expected) {
public unequal(actual, expected) {
expect.toThrow(() => {
expect.arraysToBeEqual(actual, expected);
});
Expand Down
16 changes: 8 additions & 8 deletions src/spec/assertion/toBeIn.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,32 @@ import { Test, TestSuite } from '../../testyCore';
@TestSuite('Expect ToBeIn Tests')
export class ExpectToMatch {
@Test(`'a' to be in, should succeed`)
private aToBeInSuccess() {
public aToBeInSuccess() {
expect.toBeIn('a', ['a', 'b', 'c']);
}

@Test(`'a' to be in ReadonlyArray, should succeed`)
private aToBeInReadonlySuccess() {
const readonlyArray: ReaonlyArray<string> = ['a', 'b', 'c'];
public aToBeInReadonlySuccess() {
const readonlyArray: readonly string[] = ['a', 'b', 'c'];
expect.toBeIn('a', readonlyArray);
}
}

@Test(`'a' to be in, should fail`)
private aToBeInFail() {
public aToBeInFail() {
expect.toThrow(() => {
expect.toBeIn('a', ['b', 'c', 'd']);
});
}

@Test(`'a' not to be in, should fail`)
private aNotToBeInFail() {
public aNotToBeInFail() {
expect.toThrow(() => {
expect.not.toBeIn('a', ['a', 'b', 'c']);
});
}

@Test(`'a' not to be in, should succeed`)
private aNotToBeInSuccess() {
public aNotToBeInSuccess() {
expect.not.toBeIn('a', ['b', 'c', 'd']);
}
}