Skip to content

Commit

Permalink
fix bundler test
Browse files Browse the repository at this point in the history
  • Loading branch information
vigneshshanmugam committed Aug 3, 2023
1 parent 9542141 commit 77b8d1c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
10 changes: 5 additions & 5 deletions __tests__/push/bundler.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,21 +111,21 @@ describe('Bundler', () => {
});

it('build journey', async () => {
const content = await bundler.build(journeyFile, generateTempPath());
const content = await bundler.build(journeyFile, '', generateTempPath());
await validateZip(content);
});

it('bundle should be idempotent', async () => {
const content1 = await bundler.build(journeyFile, generateTempPath());
const content2 = await bundler.build(journeyFile, generateTempPath());
const content1 = await bundler.build(journeyFile, '', generateTempPath());
const content2 = await bundler.build(journeyFile, '', generateTempPath());
expect(content1).toEqual(content2);
});

it('throw errors on incorrect path', async () => {
try {
await bundler.build(join(PROJECT_DIR, 'blah.ts'), generateTempPath());
await bundler.build(join(PROJECT_DIR, 'blah.ts'), '', generateTempPath());
} catch (e) {
expect(e.message).toContain('Build failed');
expect(e.message).toContain('no such file or directory');
}
});
});
3 changes: 3 additions & 0 deletions src/push/transform-journey.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ export async function transform(absPath: string, journeyName: string) {
retainLines: true,
babelrc: false,
configFile: false,
parserOpts: {
plugins: ['typescript'],
},
plugins: [
[
JourneyTransformPlugin,
Expand Down

0 comments on commit 77b8d1c

Please sign in to comment.