Skip to content

Commit f21657f

Browse files
committed
build: added try catch for checking stuff in the CI
1 parent 060a64a commit f21657f

File tree

4 files changed

+31
-9
lines changed

4 files changed

+31
-9
lines changed

src/utils/template-utils.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,6 @@ export async function updateWebpackFile(
133133
* @param destPath - The path where the project will be created
134134
*/
135135
export async function copyEmptyTemplateFiles(destPath: string): Promise<void> {
136-
console.log(__dirname);
137-
138136
await fs.copy(path.join(__dirname, "..", "..", "files", "empty-project"), destPath, {
139137
overwrite: true,
140138
filter: copyFilter,

tests/create-plugin.test.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@ describe("create-plugin", () => {
88
const destDir = path.join(__dirname, "tmp-files", "foo-plugin"),
99
pkgPath = path.join(destDir, "package.json");
1010

11-
await createPluginTemplate("foo", "Foo", "", destDir);
11+
try {
12+
await createPluginTemplate("foo", "Foo", "", destDir);
13+
} catch (e) {
14+
console.error(e);
15+
}
1216

1317
const pkgInfo = await fs.readJSON(pkgPath);
1418

@@ -18,9 +22,13 @@ describe("create-plugin", () => {
1822
});
1923

2024
it("should have created the plugin project, w/ repo", async () => {
21-
const destDir = path.join(__dirname,"tmp-files", "bar-plugin");
25+
const destDir = path.join(__dirname, "tmp-files", "bar-plugin");
2226

23-
await createPluginTemplate("bar", "Bar", "https://github.com/matteobruni/tsparticles", destDir);
27+
try {
28+
await createPluginTemplate("bar", "Bar", "https://github.com/matteobruni/tsparticles", destDir);
29+
} catch (e) {
30+
console.error(e);
31+
}
2432

2533
const pkgPath = path.join(destDir, "package.json"),
2634
pkgInfo = await fs.readJSON(pkgPath);

tests/create-preset.test.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@ describe("create-preset", () => {
77
it("should have created the preset project", async () => {
88
const destDir = path.join(__dirname, "tmp-files", "foo-preset");
99

10-
await createPresetTemplate("foo", "Foo", "", destDir);
10+
try {
11+
await createPresetTemplate("foo", "Foo", "", destDir);
12+
} catch (e) {
13+
console.error(e);
14+
}
1115

1216
const pkgPath = path.join(destDir, "package.json"),
1317
pkgInfo = await fs.readJSON(pkgPath);
@@ -20,7 +24,11 @@ describe("create-preset", () => {
2024
it("should have created the preset project, w/ repo", async () => {
2125
const destDir = path.join(__dirname, "tmp-files", "bar-preset");
2226

23-
await createPresetTemplate("bar", "Bar", "https://github.com/matteobruni/tsparticles", destDir);
27+
try {
28+
await createPresetTemplate("bar", "Bar", "https://github.com/matteobruni/tsparticles", destDir);
29+
} catch (e) {
30+
console.error(e);
31+
}
2432

2533
const pkgPath = path.join(destDir, "package.json"),
2634
pkgInfo = await fs.readJSON(pkgPath);

tests/create-shape.test.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@ describe("create-shape", () => {
77
it("should have created the shape project", async () => {
88
const destDir = path.join(__dirname, "tmp-files", "foo-shape");
99

10-
await createShapeTemplate("foo", "Foo", "", destDir);
10+
try {
11+
await createShapeTemplate("foo", "Foo", "", destDir);
12+
} catch (e) {
13+
console.error(e);
14+
}
1115

1216
const pkgPath = path.join(destDir, "package.json"),
1317
pkgInfo = await fs.readJSON(pkgPath);
@@ -20,7 +24,11 @@ describe("create-shape", () => {
2024
it("should have created the shape project, w/ repo", async () => {
2125
const destDir = path.join(__dirname, "tmp-files", "bar-shape");
2226

23-
await createShapeTemplate("bar", "Bar", "https://github.com/matteobruni/tsparticles", destDir);
27+
try {
28+
await createShapeTemplate("bar", "Bar", "https://github.com/matteobruni/tsparticles", destDir);
29+
} catch (e) {
30+
console.error(e);
31+
}
2432

2533
const pkgPath = path.join(destDir, "package.json"),
2634
pkgInfo = await fs.readJSON(pkgPath);

0 commit comments

Comments
 (0)