Skip to content

Commit

Permalink
test(config): adds a unit test for stringify content
Browse files Browse the repository at this point in the history
  • Loading branch information
huafu committed Sep 15, 2018
1 parent 6cc1565 commit 03c8dee
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/ts-jest-transformer.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,11 @@ Array [
`)
})

it('should return stringified version of file', () => {
config.shouldStringifyContent.mockImplementation(() => true)
expect(process()).toMatchInlineSnapshot(`"ts:module.exports=\\"export default \\\\\\"foo\\\\\\"\\""`)
})

it('should not pass the instrument option to babel-jest', () => {
args[3] = { instrument: true }
expect(process()).toBe(`babel:ts:${INPUT}`)
Expand Down

0 comments on commit 03c8dee

Please sign in to comment.