Skip to content

Commit

Permalink
Read package.json contents directly during tests
Browse files Browse the repository at this point in the history
- this eliminates OS-specific line-ending issues
  • Loading branch information
mannie-exe committed May 16, 2022
1 parent 0aecd56 commit 62bd11a
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions __tests__/installer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -608,12 +608,7 @@ describe('setup-node', () => {

it('reads package.json as node-version-file if provided', async () => {
// Arrange
const versionSpec = `{
\"engines\": {
\"node\": \">=14.0.0\"
}
}
`;
const versionSpec = fs.readFileSync(path.join(__dirname, 'data/package.json'), 'utf-8');
const versionFile = 'package.json';
const expectedVersionSpec = '14';
process.env['GITHUB_WORKSPACE'] = path.join(__dirname, 'data');
Expand Down

0 comments on commit 62bd11a

Please sign in to comment.