Skip to content

Commit

Permalink
chore: Move test from tests/doc/parse.ts to tests/doc/types.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
eemeli committed Oct 14, 2023
1 parent 1fd618e commit 2528121
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
8 changes: 0 additions & 8 deletions tests/doc/parse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -819,11 +819,3 @@ describe('CRLF line endings', () => {
expect(res).toBe('foo bar')
})
})

describe('URI malformed', () => {
test('for parseDocument', () => {
const doc = YAML.parseDocument('!!%ee 0')
expect(doc.errors).toHaveLength(1)
expect(doc.errors[0].message).toMatch(/URI malformed/)
})
})
6 changes: 6 additions & 0 deletions tests/doc/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,12 @@ describe('tags', () => {
expect(doc.errors[0].code).toBe('MISSING_CHAR')
})
}

test('malformed URI (eemeli/yaml#498)', () => {
const doc = parseDocument('!!%ee 0')
expect(doc.errors).toHaveLength(1)
expect(doc.errors[0].message).toMatch('URIError')
})
})

test('eemeli/yaml#97', () => {
Expand Down

0 comments on commit 2528121

Please sign in to comment.