Skip to content

Commit

Permalink
Merge pull request #51 from marvinhagemeister/invalid-regex
Browse files Browse the repository at this point in the history
  • Loading branch information
marvinhagemeister authored Mar 10, 2022
2 parents f222981 + 2e3e4bf commit 56071cb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ function createPreprocessor(
return async function preprocess(content, file, done) {
// We normalize the file extension to always be '.js', which allows us to
// run '.ts' files as test entry-points in a `singleBundle: false` setup.
const jsPath = file.originalPath.replace(/\.[^/]+$/, ".js");
const jsPath = file.originalPath.replace(/\.[^/.]+$/, ".js");

// Karma likes to turn a win32 path (C:\foo\bar) into a posix-like path (C:/foo/bar).
// Normally this wouldn't be so bad, but `bundle.file` is a true win32 path, and we
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ describe("simple", () => {
});

it("should serve with correct content-type", async () => {
const script = document.querySelector('script[src*="main-a.js"]');
const script = document.querySelector('script[src*="main-a.foo.js"]');

const resp = await fetchPolyfill(script.src);
if (resp.status !== 200) {
Expand All @@ -27,9 +27,9 @@ describe("simple", () => {
});

it("should serve .js.map", async () => {
const script = document.querySelector('script[src*="main-a.js"]');
const script = document.querySelector('script[src*="main-a.foo.js"]');

const src = `${script.src.replace(/[?#].*/, '')}.map`;
const src = `${script.src.replace(/[?#].*/, "")}.map`;
const resp = await fetchPolyfill(src);
if (resp.status !== 200) {
throw new Error(resp.status);
Expand Down

0 comments on commit 56071cb

Please sign in to comment.