Skip to content

Commit

Permalink
ci: remove deprecated node versions
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesgeorge007 committed Sep 20, 2023
1 parent ad04af6 commit d439de3
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
node: [12, 14]
node: [16, 18, 20]
steps:
- uses: actions/checkout@v2
- name: Setup node
Expand Down
13 changes: 9 additions & 4 deletions __e2e__/commands/init.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ describe('mevn init', () => {
});

it('creates a new MEVN stack webapp based on the GraphQL starter template', async () => {
const { exitCode } = await runPromptWithAnswers(
const { exitCode, stderr } = await runPromptWithAnswers(
['init', 'my-app'],
[
`${DOWN}${DOWN}${ENTER}`, // Choose GraphQL as the starter template
Expand All @@ -107,6 +107,8 @@ describe('mevn init', () => {
tempDirPath,
);

console.error(stderr);

expect(exitCode).toBe(0);
expect(fetchProjectConfig(genPath).template).toBe('GraphQL');
expect(fetchProjectConfig(genPath).isConfigured.client).toBe(false);
Expand All @@ -124,7 +126,7 @@ describe('mevn init', () => {
});

it('creates a new MEVN stack webapp based on the PWA starter template', async () => {
const { exitCode } = await runPromptWithAnswers(
const { exitCode, stderr } = await runPromptWithAnswers(
['init', 'my-app'],
[
`${DOWN}${ENTER}`, // Choose PWA as the starter template
Expand All @@ -134,6 +136,8 @@ describe('mevn init', () => {
tempDirPath,
);

console.error(stderr);

expect(exitCode).toBe(0);
expect(fetchProjectConfig(genPath).template).toBe('PWA');
expect(fetchProjectConfig(genPath).isConfigured.client).toBe(false);
Expand All @@ -160,10 +164,9 @@ describe('mevn init', () => {
});

it('creates a new MEVN stack webapp based on the Default starter template in current directory', async () => {
// Create my-app directory
fs.mkdirSync(genPath);

const { exitCode } = await runPromptWithAnswers(
const { exitCode, stderr } = await runPromptWithAnswers(
['init', '.'],
[
ENTER, // Choose Default as the starter template
Expand All @@ -173,6 +176,8 @@ describe('mevn init', () => {
genPath,
);

console.error(stderr);

expect(exitCode).toBe(0);
expect(fetchProjectConfig(genPath).template).toBe('Default');
expect(fetchProjectConfig(genPath).isConfigured.client).toBe(false);
Expand Down
2 changes: 1 addition & 1 deletion jest/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ export const runPromptWithAnswers = (args, answers, testPath) => {
// Cleanup
export const rmTempDir = (tempDirPath) => {
if (fs.existsSync(tempDirPath)) {
fs.rmdirSync(tempDirPath, { recursive: true });
fs.rmSync(tempDirPath, { recursive: true });
}
};
6 changes: 3 additions & 3 deletions src/utils/__tests__/helpers.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ beforeAll(() => {

afterAll(() => {
// copyDirSync()
fs.rmdirSync(srcPath, { recursive: true });
fs.rmdirSync(destPath, { recursive: true });
fs.rm(srcPath, { recursive: true });
fs.rm(destPath, { recursive: true });

// fetchProjectConfig()
fs.rmdirSync(genPath, { recursive: true });
fs.rm(genPath, { recursive: true });
});

test('copyDirSync()', () => {
Expand Down

0 comments on commit d439de3

Please sign in to comment.