Skip to content

Commit

Permalink
Browser tests now use dist from local node_modules folder instead…
Browse files Browse the repository at this point in the history
… of the package root `dist` folder. This removes some `../` from paths and simplifies artifacts handling in CI.
  • Loading branch information
dmester committed Jul 31, 2020
1 parent 58ec3c4 commit b66df53
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion test/e2e/browser/assets/amd.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ <h1>"Icon0" - AMD - Should be equal</h1>
<script src="https://cdn.jsdelivr.net/requirejs/2.1.22/require.min.js"></script>
<script>

requirejs(["/dist/jdenticon.min.js"], function (jd) {
requirejs(["/node_modules/jdenticon/dist/jdenticon.min.js"], function (jd) {
jd.update("#AMDIcon0", "Icon0");
});

Expand Down
2 changes: 1 addition & 1 deletion test/e2e/browser/assets/center.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ <h1>"Icon2" - Should be centered vertically and horizontally</h1>
backColor: "#00f1",
};
</script>
<script src="/dist/jdenticon.min.js"></script>
<script src="/node_modules/jdenticon/dist/jdenticon.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/require1k@1.0.1/require1k.min.js"></script>
<script>
jdenticon.update("#canvas-Icon2-update-vert,#svg-Icon2-update-vert", "Icon2");
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/browser/assets/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<iframe name="padding-30" src="padding.html?padding=30"></iframe>
<iframe name="center" src="center.html"></iframe>

<script src="/dist/jdenticon.min.js"></script>
<script src="/node_modules/jdenticon/dist/jdenticon.min.js"></script>
<script>

var BROWSER_REGEX = ["Firefox/", "SamsungBrowser/", "Opera/", "OPR/", "MSIE ", "Trident/", "Edge?/", "Chrome/", "Safari/"];
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/browser/assets/normal.html
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ <h1>"Icon04" - Should be equal but different to the icon above</h1>
};
</script>
<script src="https://cdn.jsdelivr.net/jquery/3.2.1/jquery.slim.min.js"></script>
<script src="/dist/jdenticon.min.js"></script>
<script src="/node_modules/jdenticon/dist/jdenticon.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/require1k@1.0.1/require1k.min.js"></script>
<script>
// Explicit config
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/browser/assets/padding.html
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ <h1>"Icon04" - Should be equal - <span id="padding-percent"></span>% padding in
};
</script>
<script src="https://cdn.jsdelivr.net/jquery/3.2.1/jquery.slim.min.js"></script>
<script src="/dist/jdenticon.min.js"></script>
<script src="/node_modules/jdenticon/dist/jdenticon.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/require1k@1.0.1/require1k.min.js"></script>
<script>
jdenticon.update("#canvas-Jdenticon-update-value,#svg-Jdenticon-update-value", "Icon04");
Expand Down
4 changes: 2 additions & 2 deletions test/e2e/browser/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ async function testBrowser(browserName) {
}

await serve(
path.join(__dirname, "../../../"),
path.join(__dirname, "../"),
{
"index": ["index.html"],
setHeaders: resp => {
Expand All @@ -130,7 +130,7 @@ async function testBrowser(browserName) {
}
},
async listener => {
const url = "http://localhost:" + listener.address().port + "/test/e2e/browser/assets/";
const url = "http://localhost:" + listener.address().port + "/browser/assets/";

console.log(`Screenshot in ${browserName}`);
console.log(url);
Expand Down

0 comments on commit b66df53

Please sign in to comment.