Add extra tests and use toEqual matcher.

Turns out that toMatchObject would allow extra properties through
This commit is contained in:
Josh Dales
2023-03-20 17:23:11 -04:00
parent cc1e02580b
commit d0d3628020
3 changed files with 42 additions and 29 deletions

View File

@@ -20,7 +20,7 @@ describe('toMatchConfig', () => {
it('returns a MatchConfig object with all options', () => {
const result = toMatchConfig(config);
expect(result).toMatchObject<MatchConfig>({
expect(result).toEqual<MatchConfig>({
changedFiles: {
all: ['testing-all'],
any: ['testing-any']
@@ -35,7 +35,7 @@ describe('toMatchConfig', () => {
it('does not include the unexpected items in the returned MatchConfig object', () => {
const result = toMatchConfig(config);
expect(result).toMatchObject<MatchConfig>({
expect(result).toEqual<MatchConfig>({
changedFiles: {
all: ['testing-all'],
any: ['testing-any']