Skip to content

Commit 056fecd

Browse files
committed
[INTERNAL] Move "init" test fixtures to separate folder
1 parent bca8593 commit 056fecd

File tree

10 files changed

+8
-4
lines changed

10 files changed

+8
-4
lines changed

test/lib/init/init.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,13 @@ const path = require("path");
44
const ui5Cli = require("../../../");
55
const init = ui5Cli.init;
66

7+
function getFixturePath(fixtureName) {
8+
return path.join(__dirname, "..", "..", "fixtures", "init", fixtureName);
9+
}
10+
711
test("Init for application", async (t) => {
812
const projectConfig = await init({
9-
cwd: path.join(__dirname, "..", "..", "fixtures", "init-application")
13+
cwd: getFixturePath("application")
1014
});
1115

1216
t.deepEqual(projectConfig, {
@@ -20,7 +24,7 @@ test("Init for application", async (t) => {
2024

2125
test("Init for library", async (t) => {
2226
const projectConfig = await init({
23-
cwd: path.join(__dirname, "..", "..", "fixtures", "init-library")
27+
cwd: getFixturePath("library")
2428
});
2529

2630
t.deepEqual(projectConfig, {
@@ -34,7 +38,7 @@ test("Init for library", async (t) => {
3438

3539
test("Init for invalid project (Found 'webapp' and 'src' folders)", async (t) => {
3640
await t.throws(init({
37-
cwd: path.join(__dirname, "..", "..", "fixtures", "init-invalid-webapp-src")
41+
cwd: getFixturePath("invalid-webapp-src")
3842
}),
3943
"Could not detect project type: Found 'webapp' and 'src' folders.\n" +
4044
"Applications should only have a 'webapp' folder.\n" +
@@ -43,7 +47,7 @@ test("Init for invalid project (Found 'webapp' and 'src' folders)", async (t) =>
4347

4448
test("Init for invalid project (No package.json)", async (t) => {
4549
await t.throws(init({
46-
cwd: path.join(__dirname, "..", "..", "fixtures", "init-invalid-no-package-json")
50+
cwd: getFixturePath("invalid-no-package-json")
4751
}),
4852
"Initialization not possible: Missing package.json file");
4953
});

0 commit comments

Comments
 (0)