diff --git a/package.json b/package.json index 0c399ca9..119a44c0 100644 --- a/package.json +++ b/package.json @@ -32,6 +32,7 @@ "@types/node": "^10.11.3", "@types/puppeteer": "^1.8.0", "chai": "^4.1.2", + "jest-snapshot": "^23.6.0", "mocha": "^5.2.0", "puppeteer": "^1.9.0", "rollup": "^0.66.4", diff --git a/test.d.ts b/test.d.ts index cbe3deb6..a3b614ee 100644 --- a/test.d.ts +++ b/test.d.ts @@ -2,3 +2,20 @@ declare module 'rollup-plugin-typescript' { function typescript(): any; export = typescript; } + +declare module 'jest-snapshot' { + export class SnapshotState { + constructor(testFile: string, options: any); + + save(): any; + } + type matchResult = { + pass: boolean; + report(): string; + }; + export function toMatchSnapshot( + received: any, + propertyMatchers?: any, + testName?: string, + ): matchResult; +} diff --git a/test/__snapshots__/integration.ts.snap b/test/__snapshots__/integration.ts.snap new file mode 100644 index 00000000..6aba1b5e --- /dev/null +++ b/test/__snapshots__/integration.ts.snap @@ -0,0 +1,133 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`[html file]: about-mozilla.html 1`] = ` +"
++ Mammon slept. And the beast reborn spread over the earth and its numbers + grew legion. And they proclaimed the times and sacrificed crops unto the + fire, with the cunning of foxes. And they built a new world in their own + image as promised by the + sacred words, and spoke + of the beast with their children. Mammon awoke, and lo! it was + naught but a follower. +
+ from The Book of Mozilla, 11:9
(10th Edition)
+