Skip to content

Commit

Permalink
Remove gatsby init tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinstubbs committed Aug 19, 2024
1 parent 12ce418 commit a66954f
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 54 deletions.
50 changes: 0 additions & 50 deletions packages/cli/src/cli/commands/init.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,29 +46,6 @@ test("should be able to init starter kit for nextjs template", async () => {
fs.rmSync(appFolder, { recursive: true, force: true });
});

test("should be able to init starter kit for gatsby template", async () => {
const appFolder = tmp.tmpNameSync();

await executePCC("init", [appFolder, "--template", "gatsby", "--use-pnpm"]);

// Eslint should not be initialized
expect(fs.existsSync(`${appFolder}/.eslintrc.json`)).toBe(false);

// Checking if primary required files for Gatsby starter kit are created.
expect(fs.existsSync(`${appFolder}/gatsby-browser.js`)).toBe(true);
expect(fs.existsSync(`${appFolder}/gatsby-config.js`)).toBe(true);
expect(fs.existsSync(`${appFolder}/gatsby-browser.js`)).toBe(true);

// package.json checks
expect(fs.existsSync(`${appFolder}/package.json`)).toBe(true);
const packageJson = JSON.parse(
readFileSync(`${appFolder}/package.json`).toString(),
);
expect(packageJson.name).toBe(path.parse(appFolder).base);

// Remove app folder
fs.rmSync(appFolder, { recursive: true, force: true });
});

Check failure on line 49 in packages/cli/src/cli/commands/init.test.ts

View workflow job for this annotation

GitHub Actions / lint

Delete `⏎`
test("should be able to init starter kit for nextjs template with typescript", async () => {
const appFolder = tmp.tmpNameSync();
Expand Down Expand Up @@ -99,33 +76,6 @@ test("should be able to init starter kit for nextjs template with typescript", a
fs.rmSync(appFolder, { recursive: true, force: true });
});

test("should be able to init starter kit for gatsby template with typescript", async () => {
const appFolder = tmp.tmpNameSync();

await executePCC("init", [appFolder, "--template", "gatsby", "--ts"]);

// Check that TypesScript source files exist.
expect(fs.existsSync(`${appFolder}/src/templates/index.tsx`)).toBe(true);

// Eslint should not be initialized
expect(fs.existsSync(`${appFolder}/.eslintrc.json`)).toBe(false);

// Checking if primary required files for Gatsby starter kit are created
expect(fs.existsSync(`${appFolder}/gatsby-browser.js`)).toBe(true);
expect(fs.existsSync(`${appFolder}/gatsby-config.js`)).toBe(true);
expect(fs.existsSync(`${appFolder}/gatsby-browser.js`)).toBe(true);

// package.json checks
expect(fs.existsSync(`${appFolder}/package.json`)).toBe(true);
const packageJson = JSON.parse(
readFileSync(`${appFolder}/package.json`).toString(),
);
expect(packageJson.name).toBe(path.parse(appFolder).base);

// Remove app folder
fs.rmSync(appFolder, { recursive: true, force: true });
});

test("should be able to init starter kit with eslint and app name", async () => {
const appFolder = tmp.tmpNameSync();

Expand Down
4 changes: 0 additions & 4 deletions packages/cli/src/cli/commands/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -274,10 +274,6 @@ export const INIT_EXAMPLES = [
description: "Create project with nextjs template",
command: "pcc init new_proj",
},
{
description: "Create project with gatsby template",
command: "pcc init new_proj --template=gatsby",
},
{
description: "Create project using pnpm package manager",
command: "pcc init new_proj --use-pnpm",
Expand Down

0 comments on commit a66954f

Please sign in to comment.