Skip to content

Commit

Permalink
Increase coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
KSXGitHub committed May 4, 2018
1 parent b0e210d commit ae8f4ac
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/typescript/monorepo-shared-yaml/test/.data/load.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
root:
source.yaml: |
hello: world
not-yaml: |
this: is: not: valid: yaml: syntax:
because: semicolons: is: placed: everywhere:
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,9 @@ Object {
"hello": "world",
}
`;

exports[`throws error matching snapshot 1`] = `
"Failed to parse 'root/not-yaml': incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line at line 1, column 9:
this: is: not: valid: yaml: syntax:
^"
`;
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,9 @@ Object {
"hello": "world",
}
`;

exports[`throws error matching snapshot 1`] = `
[Error: Failed to parse 'root/not-yaml': incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line at line 1, column 9:
this: is: not: valid: yaml: syntax:
^]
`;
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,7 @@ const {apply} = createVirtualEnvironment('load.yaml')
it('matches snapshot', apply(async () => {
expect(subject.loadFileSync('root/source.yaml')).toMatchSnapshot()
}))

it('throws error matching snapshot', apply(async () => {
expect(() => subject.loadFileSync('root/not-yaml')).toThrowErrorMatchingSnapshot()
}))
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,7 @@ const {apply} = createVirtualEnvironment('load.yaml')
it('matches snapshot', apply(async () => {
expect(await subject.loadFile('root/source.yaml')).toMatchSnapshot()
}))

it('throws error matching snapshot', apply(async () => {
expect(subject.loadFile('root/not-yaml')).rejects.toMatchSnapshot()
}))

0 comments on commit ae8f4ac

Please sign in to comment.