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 15, 2022
1 parent db506ad commit 197515f
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions __tests__/installer.test.ts
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 197515f

Please sign in to comment.