diff options
Diffstat (limited to 'packages/turbo-codemod/templates/transformer.test.hbs')
| -rw-r--r-- | packages/turbo-codemod/templates/transformer.test.hbs | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/packages/turbo-codemod/templates/transformer.test.hbs b/packages/turbo-codemod/templates/transformer.test.hbs new file mode 100644 index 0000000..c63a9df --- /dev/null +++ b/packages/turbo-codemod/templates/transformer.test.hbs @@ -0,0 +1,25 @@ +import { transformer } from "../src/transforms/{{ name }}"; +import { setupTestFixtures } from "./test-utils"; + +describe("{{ name }}", () => { + + const { useFixture } = setupTestFixtures({ test: "{{ name }}" }); + + test("basic", () => { + // load the fixture for the test + const { root, read, readJson } = useFixture({ + fixture: "specific-fixture", + }); + + // run the transformer + const result = transformer({ + root, + options: { force: false, dry: false, print: false }, + }); + + // result should be correct + expect(result.fatalError).toBeUndefined(); + expect(result.changes).toMatchInlineSnapshot(); + }); +}); + |