Add node modules and new code for release (#39)
Co-authored-by: tbarnes94 <tbarnes94@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
a10d84bc2e
commit
7ad2aa66bb
@ -20,12 +20,12 @@ const util = require("util");
|
||||
describe('Testing all functions in run file.', () => {
|
||||
test('getExecutableExtension() - return .exe when os is Windows', () => {
|
||||
jest.spyOn(os, 'type').mockReturnValue('Windows_NT');
|
||||
expect(helpers_1.getExecutableExtension()).toBe('.exe');
|
||||
expect((0, helpers_1.getExecutableExtension)()).toBe('.exe');
|
||||
expect(os.type).toBeCalled();
|
||||
});
|
||||
test('getExecutableExtension() - return empty string for non-windows OS', () => {
|
||||
jest.spyOn(os, 'type').mockReturnValue('Darwin');
|
||||
expect(helpers_1.getExecutableExtension()).toBe('');
|
||||
expect((0, helpers_1.getExecutableExtension)()).toBe('');
|
||||
expect(os.type).toBeCalled();
|
||||
});
|
||||
test.each([
|
||||
@ -34,7 +34,7 @@ describe('Testing all functions in run file.', () => {
|
||||
['x64', 'amd64']
|
||||
])("getKubectlArch() - return on %s os arch %s kubectl arch", (osArch, kubectlArch) => {
|
||||
jest.spyOn(os, 'arch').mockReturnValue(osArch);
|
||||
expect(helpers_1.getKubectlArch()).toBe(kubectlArch);
|
||||
expect((0, helpers_1.getKubectlArch)()).toBe(kubectlArch);
|
||||
expect(os.arch).toBeCalled();
|
||||
});
|
||||
test.each([
|
||||
@ -44,7 +44,7 @@ describe('Testing all functions in run file.', () => {
|
||||
])('getkubectlDownloadURL() - return the URL to download %s kubectl for Linux', (arch) => {
|
||||
jest.spyOn(os, 'type').mockReturnValue('Linux');
|
||||
const kubectlLinuxUrl = util.format('https://storage.googleapis.com/kubernetes-release/release/v1.15.0/bin/linux/%s/kubectl', arch);
|
||||
expect(helpers_1.getkubectlDownloadURL('v1.15.0', arch)).toBe(kubectlLinuxUrl);
|
||||
expect((0, helpers_1.getkubectlDownloadURL)('v1.15.0', arch)).toBe(kubectlLinuxUrl);
|
||||
expect(os.type).toBeCalled();
|
||||
});
|
||||
test.each([
|
||||
@ -54,7 +54,7 @@ describe('Testing all functions in run file.', () => {
|
||||
])('getkubectlDownloadURL() - return the URL to download %s kubectl for Darwin', (arch) => {
|
||||
jest.spyOn(os, 'type').mockReturnValue('Darwin');
|
||||
const kubectlDarwinUrl = util.format('https://storage.googleapis.com/kubernetes-release/release/v1.15.0/bin/darwin/%s/kubectl', arch);
|
||||
expect(helpers_1.getkubectlDownloadURL('v1.15.0', arch)).toBe(kubectlDarwinUrl);
|
||||
expect((0, helpers_1.getkubectlDownloadURL)('v1.15.0', arch)).toBe(kubectlDarwinUrl);
|
||||
expect(os.type).toBeCalled();
|
||||
});
|
||||
test.each([
|
||||
@ -64,7 +64,7 @@ describe('Testing all functions in run file.', () => {
|
||||
])('getkubectlDownloadURL() - return the URL to download %s kubectl for Windows', (arch) => {
|
||||
jest.spyOn(os, 'type').mockReturnValue('Windows_NT');
|
||||
const kubectlWindowsUrl = util.format('https://storage.googleapis.com/kubernetes-release/release/v1.15.0/bin/windows/%s/kubectl.exe', arch);
|
||||
expect(helpers_1.getkubectlDownloadURL('v1.15.0', arch)).toBe(kubectlWindowsUrl);
|
||||
expect((0, helpers_1.getkubectlDownloadURL)('v1.15.0', arch)).toBe(kubectlWindowsUrl);
|
||||
expect(os.type).toBeCalled();
|
||||
});
|
||||
test('getStableKubectlVersion() - download stable version file, read version and return it', () => __awaiter(void 0, void 0, void 0, function* () {
|
||||
|
||||
Reference in New Issue
Block a user