loader-generator.test.js 483 B

123456789101112131415
  1. "use strict";
  2. const { makeLoaderName } = require("./loader-generator");
  3. describe("makeLoaderName", () => {
  4. it("should kebab-case loader name and append '-loader'", () => {
  5. const loaderName = makeLoaderName("This is a test");
  6. expect(loaderName).toEqual("this-is-a-test-loader");
  7. });
  8. it("should not modify a properly formatted loader name", () => {
  9. const loaderName = makeLoaderName("properly-named-loader");
  10. expect(loaderName).toEqual("properly-named-loader");
  11. });
  12. });