Skip to content

Commit

Permalink
chore: fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
shellscape committed Nov 15, 2024
1 parent 99f1401 commit eb50c5a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
3 changes: 2 additions & 1 deletion test/cli/.snapshots/create-jsx-email.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

exports[`create-jsx-email > command 1`] = `
"
create-jsx-email v2.0.4
create-jsx-email
The fastest way to get started with JSX Email
Expand Down Expand Up @@ -126,6 +126,7 @@ export const Template = ({ email, name }: TemplateProps) => (
exports[`create-jsx-email > command 3`] = `
[
".test/new/.gitignore",
".test/new/README.md",
".test/new/package.json",
".test/new/tsconfig.json",
Expand Down
7 changes: 5 additions & 2 deletions test/cli/create-jsx-email.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,17 @@ describe('create-jsx-email', async () => {
// Note: For some reason `pnpm exec` is fucking with our CWD, and resets it to
// packages/jsx-email, which causes the config not to be found. so we use npx instead
})`IS_CLI_TEST=true create-jsx-email .test/new --yes`;
const plain = strip(stdout).replace(/^(.*)create-jsx-email/, 'create-jsx-email');
const plain = strip(stdout)
.replace(/^(.*)create-jsx-email/, 'create-jsx-email')
.replace(/v(\d+\.\d+\.\d+)/, '');

expect(plain).toMatchSnapshot();

const contents = await readFile(join(__dirname, '.test/new/templates/email.tsx'), 'utf8');
expect(contents).toMatchSnapshot();

const files = await globby('.test/new/**/*');
const files = await globby('.test/new/**/*', { dot: true });

expect(files).toMatchSnapshot();
});
});

0 comments on commit eb50c5a

Please sign in to comment.