Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
remove prepend in favor of replaces improve code style in ContextDependencyHelpers
- Loading branch information
Showing
6 changed files
with
136 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
export default function a() { | ||
return 'a' | ||
return 'a' + __resourceQuery | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export default function abc() { | ||
return 'abc' + __resourceQuery | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,57 @@ | ||
it("should detect query strings in dynamic import as a static value 1 ", function() { | ||
import("./a?queryString").then(({ default: a }) => { | ||
expect(a()).toBe("a"); | ||
}); | ||
return Promise.all([ | ||
import("./a").then(({ default: a }) => { | ||
expect(a()).toBe("a"); | ||
}), | ||
import("./abc").then(({ default: a }) => { | ||
expect(a()).toBe("abc"); | ||
}), | ||
import("./a?queryString").then(({ default: a }) => { | ||
expect(a()).toBe("a?queryString"); | ||
}), | ||
import("./abc?query?String").then(({ default: a }) => { | ||
expect(a()).toBe("abc?query?String"); | ||
}), | ||
]); | ||
}); | ||
|
||
it("should detect query strings in dynamic import as a static value 2", function() { | ||
var testFileName = "a"; | ||
|
||
import(`./${testFileName}?queryString`).then(({ default: a }) => { | ||
expect(a()).toBe("a"); | ||
}); | ||
var testFileName = "a"; | ||
|
||
return Promise.all([ | ||
import(`./${testFileName}`).then(({ default: a }) => { | ||
expect(a()).toBe("a"); | ||
}), | ||
import(`./${testFileName}bc`).then(({ default: a }) => { | ||
expect(a()).toBe("abc"); | ||
}), | ||
import(`./${testFileName}?queryString`).then(({ default: a }) => { | ||
expect(a()).toBe("a?queryString"); | ||
}), | ||
import(`./${testFileName}bc?query?String`).then(({ default: a }) => { | ||
expect(a()).toBe("abc?query?String"); | ||
}) | ||
]); | ||
}); | ||
|
||
it("should detect query strings in dynamic import as a static value 2", function() { | ||
var testFileName = "a"; | ||
|
||
return Promise.all([ | ||
import("./" + testFileName).then(({ default: a }) => { | ||
expect(a()).toBe("a"); | ||
}), | ||
import("./" + testFileName + "").then(({ default: a }) => { | ||
expect(a()).toBe("a"); | ||
}), | ||
import("./" + testFileName + "bc").then(({ default: a }) => { | ||
expect(a()).toBe("abc"); | ||
}), | ||
import("./" + testFileName + "?queryString").then(({ default: a }) => { | ||
expect(a()).toBe("a?queryString"); | ||
}), | ||
import("./" + testFileName + "bc?query?String").then(({ default: a }) => { | ||
expect(a()).toBe("abc?query?String"); | ||
}) | ||
]); | ||
}); |