UNPKG

storybook-framework-cedarjs

Version:
20 lines (19 loc) 436 B
function mockAuth() { return { name: "mock-@cedarjs/auth", enforce: "pre", transform(code, id) { if (id.includes("web/src/auth")) { code = code.replace( /(import\s*{\s*[^}]*)(\bcreateAuth\b)(,?)([^}]*})/, "$1$4" ); code = "import { createAuthentication as createAuth } from '@cedarjs/testing/auth'\n" + code; } return code; } }; } export { mockAuth };