aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/packages/turbo-codemod/templates/transformer.test.hbs
blob: c63a9df4bf4ca7ba454aacf369dd214b6b106ef0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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();
  });
});