aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/packages/turbo-codemod/templates/transformer.test.hbs
diff options
context:
space:
mode:
author简律纯 <hsiangnianian@outlook.com>2023-04-28 01:36:44 +0800
committer简律纯 <hsiangnianian@outlook.com>2023-04-28 01:36:44 +0800
commitdd84b9d64fb98746a230cd24233ff50a562c39c9 (patch)
treeb583261ef00b3afe72ec4d6dacb31e57779a6faf /packages/turbo-codemod/templates/transformer.test.hbs
parent0b46fcd72ac34382387b2bcf9095233efbcc52f4 (diff)
downloadHydroRoll-dd84b9d64fb98746a230cd24233ff50a562c39c9.tar.gz
HydroRoll-dd84b9d64fb98746a230cd24233ff50a562c39c9.zip
Diffstat (limited to 'packages/turbo-codemod/templates/transformer.test.hbs')
-rw-r--r--packages/turbo-codemod/templates/transformer.test.hbs25
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();
+ });
+});
+