Skip to content
This repository has been archived by the owner on May 22, 2024. It is now read-only.

Commit

Permalink
chore: add test for V2 pattern (#1641)
Browse files Browse the repository at this point in the history
  • Loading branch information
eduardoboucas committed Nov 9, 2023
1 parent cacee3f commit 52a6654
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/unit/runtimes/node/in_source_config.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ describe('V2 API', () => {
const isc = parseSource(source, options)
expect(isc).toEqual({ inputModuleFormat: 'esm', routes: [], schedule: '@daily', runtimeAPIVersion: 2 })
})

// This is the Remix handler
test('ESM file with handler generated by a function, exported in same expression as config', () => {
const source = `
Expand Down Expand Up @@ -285,6 +286,17 @@ describe('V2 API', () => {

expect(isc).toEqual({ inputModuleFormat: 'cjs', routes: [], runtimeAPIVersion: 2 })
})

test('ESM file with a default export consisting of a function call', () => {
const source = `import * as build from "@remix-run/dev/server-build";
import { createRequestHandler } from "@netlify/remix-edge-adapter";
export default createRequestHandler({ build });`

const isc = parseSource(source, options)

expect(isc).toEqual({ inputModuleFormat: 'esm', routes: [], runtimeAPIVersion: 2 })
})
})

describe('`scheduled` property', () => {
Expand Down

1 comment on commit 52a6654

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⏱ Benchmark results

  • largeDepsEsbuild: 3.5s
  • largeDepsNft: 11.1s
  • largeDepsZisi: 21.3s

Please sign in to comment.