Skip to content

Commit

Permalink
Merge pull request #80 from Testy/fix-tests
Browse files Browse the repository at this point in the history
Fix tests
  • Loading branch information
Aboisier authored Jul 12, 2021
2 parents 698d4a2 + 68ae878 commit a0b10cc
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
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']);
}
}

0 comments on commit a0b10cc

Please sign in to comment.