Skip to content

Commit

Permalink
fix: node application-json tests
Browse files Browse the repository at this point in the history
  • Loading branch information
erunion committed Sep 13, 2023
1 parent 9579e1b commit 2ec8614
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/integration.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,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' && fixtureExtension !== '.cjs') {
if (['.js', '.cjs'].includes(fixtureExtension)) {
throw err;
}

Expand Down Expand Up @@ -273,7 +273,7 @@ function integrationTest(
// Of course the side effect to this is is that now these test cases may be subject
// to flakiness but without updating the root snippets to not use `console.log()`,
// which we don't want to do, this is the way it's got to be.
if (fixture === 'application-json' && fixtureExtension === '.js') {
if (fixture === 'application-json' && ['.js', '.cjs'].includes(fixtureExtension)) {
const respJSON = response.json;
respJSON.arr_mix[2] = { arr_mix_nested: [] };

Expand Down

0 comments on commit 2ec8614

Please sign in to comment.