|
| 1 | +'use strict' |
| 2 | + |
| 3 | +const { execSync } = require('node:child_process') |
| 4 | +const path = require('node:path') |
| 5 | + |
| 6 | +const { FakeAgent, createSandbox } = require('../helpers') |
| 7 | + |
| 8 | +// This should switch to our withVersion helper. The order here currently matters. |
| 9 | +const esbuildVersions = ['latest', '0.16.12'] |
| 10 | + |
| 11 | +esbuildVersions.forEach((version) => { |
| 12 | + describe('OpenFeature', () => { |
| 13 | + let sandbox, agent, cwd |
| 14 | + |
| 15 | + before(async () => { |
| 16 | + sandbox = await createSandbox([`esbuild@${version}`, 'hono', '@hono/node-server'], false, [__dirname]) |
| 17 | + cwd = sandbox.folder |
| 18 | + // remove all node_modules and bun.lock file and install with yarn |
| 19 | + // TODO add this in createSandbox if it's need in more places |
| 20 | + execSync(`rm -rf ${path.join(cwd, 'node_modules')}`, { cwd }) |
| 21 | + execSync(`rm -rf ${path.join(cwd, 'bun.lock')}`, { cwd }) |
| 22 | + execSync('npm install -g yarn', { cwd }) |
| 23 | + |
| 24 | + execSync('yarn', { cwd }) |
| 25 | + }) |
| 26 | + |
| 27 | + beforeEach(async () => { |
| 28 | + agent = await new FakeAgent().start() |
| 29 | + }) |
| 30 | + |
| 31 | + after(() => { |
| 32 | + sandbox.remove() |
| 33 | + }) |
| 34 | + |
| 35 | + afterEach(() => { |
| 36 | + agent.stop() |
| 37 | + }) |
| 38 | + |
| 39 | + it('should not crash build after installing with yarn', () => { |
| 40 | + execSync('node esbuild/build.esm-hono-output-esm.mjs', { cwd }) |
| 41 | + }) |
| 42 | + }) |
| 43 | +}) |
0 commit comments