Skip to content

Commit

Permalink
fix: broken integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
erunion committed Sep 13, 2023
1 parent 11ac38a commit 579177f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,12 +168,13 @@ availableTargets()

function integrationTest(
clientId: string,
{ key: targetId, cli: targetCLI, extname: fixtureExtension }: AvailableTarget,
{ key: targetId, cli: targetCLI }: AvailableTarget,
fixture: string,
request: Request,
) {
test(`should return the expected response for \`${fixture}\``, () => {
const basePath = path.join('src', 'targets', targetId, clientId, 'fixtures', `${fixture}${extname(targetId)}`);
const fixtureExtension = extname(targetId, clientId);
const basePath = path.join('src', 'targets', targetId, clientId, 'fixtures', `${fixture}${fixtureExtension}`);

// Clone the fixture we're testing against to another object because for multipart cases
// we're deleting the header, and if we don't clone the fixture to another object, that
Expand Down Expand Up @@ -230,7 +231,7 @@ function integrationTest(
// Some JS targets print out their response with `console.log(json)` which creates
// a JSON object that we can't access with `JSON.parse()`.
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/eval#never_use_eval!
if (fixtureExtension !== '.js') {
if (fixtureExtension !== '.js' && fixtureExtension !== '.cjs') {
throw err;
}

Expand Down

0 comments on commit 579177f

Please sign in to comment.