How to use the @kosko/migrate.migrateString function in @kosko/migrate

To help you get started, we’ve selected a few @kosko/migrate examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github tommy351 / kosko / packages / cli / src / commands / __tests__ / migrate.ts View on Github external
test("should call print with result", async () => {
    const expected = migrateString(input);
    expect(print).toHaveBeenCalledWith(expected);
  });
});
github tommy351 / kosko / packages / cli / src / commands / __tests__ / migrate.ts View on Github external
test("should call print with result", async () => {
    const expected = migrateString(
      await readFile(join(fixturePath, "only-deployment.yaml"), "utf8")
    );

    expect(print).toHaveBeenCalledWith(expected);
  });
});
github tommy351 / kosko / packages / cli / src / commands / __tests__ / migrate.ts View on Github external
test("should call print with result", async () => {
    const contents = await Promise.all(
      ["only-deployment.yaml", "deployment-and-service.yaml"].map(file =>
        readFile(join(fixturePath, file), "utf8")
      )
    );
    const expected = migrateString("---\n" + contents.join("\n"));

    expect(print).toHaveBeenCalledWith(expected);
  });
});
github tommy351 / kosko / packages / cli / src / commands / __tests__ / migrate.ts View on Github external
test("should call print with result", async () => {
    const files = await readDir(fixturePath);
    const contents = await Promise.all(
      files.map(file => readFile(join(fixturePath, file), "utf8"))
    );
    const expected = migrateString(contents.join("---\n"));
    expect(print).toHaveBeenCalledWith(expected);
  });
});
github tommy351 / kosko / packages / cli / src / commands / migrate.ts View on Github external
async handler(args) {
    const file = concatFiles(await readFiles(args.cwd, toArray(args.filename)));
    const content = migrateString(file);

    await print(content);
  }
};

@kosko/migrate

Migrate Kubernetes YAML into kosko components.

MIT
Latest version published 6 months ago

Package Health Score

72 / 100
Full package analysis

Popular @kosko/migrate functions