Skip to content

Commit

Permalink
build: fix
Browse files Browse the repository at this point in the history
  • Loading branch information
gregmagolan committed Jun 12, 2019
1 parent 90719a9 commit f2bcb4c
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions internal/npm_install/test/check.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,10 @@ const fs = require('fs');
const path = require('path');
const unidiff = require('unidiff')

const actualFolder = path.posix.join(path.dirname(__filename), '../../../../npm_install_test');
const goldenFolder = path.posix.join(path.dirname(__filename), 'golden');

function check(file, updateGolden = false) {
// Strip comments from generated file for comparison to golden
// to make comparison less brittle
const actual = path.posix.join(actualFolder, file);
const actual = require.resolve(path.posix.join('npm_install_test', file));
const actualContents =
fs.readFileSync(actual, {encoding: 'utf-8'})
.replace(/\r\n/g, '\n')
Expand All @@ -21,7 +18,7 @@ function check(file, updateGolden = false) {
.replace(/[\n]+/g, '\n');

// Load the golden file for comparison
const golden = path.posix.join(goldenFolder, file + '.golden');
const golden = path.posix.join(path.dirname(__filename), 'golden', file + '.golden');

if (updateGolden) {
// Write to golden file
Expand Down

0 comments on commit f2bcb4c

Please sign in to comment.