removed unnessary test

* added fail-fast to strategy  in versions.yml
* refactored logic in main that was causing test to fail
This commit is contained in:
La'Kaleigh Harris 2021-10-06 16:40:36 +00:00 committed by GitHub
parent 7fb46efb66
commit ec979d0561
4 changed files with 98 additions and 138 deletions

View file

@ -575,7 +575,7 @@ describe('setup-node', () => {
it('Reads node-version-file if provided', async () => {
// Arrange
const versionSpec = 'v12';
const versionFile = '.immrc';
const versionFile = '.nvmrc';
const expectedVersionSpec = '12';
inputs['node-version-file'] = versionFile;
@ -597,6 +597,7 @@ describe('setup-node', () => {
`Resolved ${versionFile} as ${expectedVersionSpec}`
);
});
describe('LTS version', () => {
beforeEach(() => {
os.platform = 'linux';
@ -815,46 +816,4 @@ describe('setup-node', () => {
});
});
});
describe('node-version-file', () => {
let getVersionsFromDist: jest.SpyInstance;
beforeEach(() => {
// @actions/core
console.log('::stop-commands::stoptoken'); // Disable executing of runner commands when running tests in actions
getVersionsFromDist = jest.spyOn(im, 'getVersionsFromDist');
// gets
getVersionsFromDist.mockImplementation(
() => <im.INodeVersion>nodeTestDist
);
});
afterEach(() => {
jest.resetAllMocks();
jest.clearAllMocks();
//jest.restoreAllMocks();
});
afterAll(async () => {
console.log('::stoptoken::'); // Re-enable executing of runner commands when running tests in actions
}, 100000);
//--------------------------------------------------
// Manifest find tests
//--------------------------------------------------
describe('parseNodeVersionFile', () => {
it('without `v` prefix', async () => {
// Arrange
const versionSpec = '12';
// Act
const result = await im.parseNodeVersionFile(versionSpec);
// Assert
expect(result).toBe(versionSpec);
});
});
});
});