-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: mock maven and npm providers in unitests (#67)
* test: mock npm interactions in UT * test: mock UT of java maven provider * test: adapt mocha and c8 to test rewired modules --------- Signed-off-by: Zvi Grinberg <[email protected]>
- Loading branch information
1 parent
4e15a50
commit d91b678
Showing
36 changed files
with
35,817 additions
and
169 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import babelCore from "babel-core"; | ||
import fs from "fs"; | ||
|
||
async function dynamicImportProvider(path) { | ||
return await import(path) | ||
} | ||
|
||
/** | ||
* | ||
* @param path | ||
* @return providerInstance - provider instance that exposing private method/functions/properties to be mocked/stubbed | ||
*/ | ||
export function rewireProvider(path) | ||
{ | ||
let providerBuffeer = fs.readFileSync(path + ".js") | ||
let providerSource = babelCore.transform(providerBuffeer, {plugins: ["babel-plugin-rewire"]}).code; | ||
fs.writeFileSync(path + "_rewire.js",providerSource) | ||
return dynamicImportProvider("../../" + path + "_rewire.js" ) | ||
} |
1 change: 1 addition & 0 deletions
1
test/providers/tst_manifests/maven/pom_deps_with_ignore_on_artifact/dep-tree.txt
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 @@ | ||
pom-with-deps-and-ignore:pom-with-dependency-not-ignored-for-tests:jar:0.0.1 |
Oops, something went wrong.