Skip to content

Commit

Permalink
chore: removing some non-used mocks (#217)
Browse files Browse the repository at this point in the history
  • Loading branch information
lholmquist authored May 14, 2020
1 parent 4939d14 commit b103559
Showing 1 changed file with 1 addition and 48 deletions.
49 changes: 1 addition & 48 deletions test/openshift-client-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,7 @@ test('openshift rest client', (t) => {
});

test('openshift client tests', (t) => {
// Need to stub the config loader for these tests
const stubbedConfig = (client) => {
return Promise.resolve(client);
};

const openshiftRestClient = proxyquire('../lib/openshift-rest-client', {
'kubernetes-client': {
config: {
fromKubeconfig: stubbedConfig
}
}
});
const openshiftRestClient = require('../lib/openshift-rest-client');

const osClient = openshiftRestClient();
t.equal(osClient instanceof Promise, true, 'should return a Promise');
Expand Down Expand Up @@ -83,17 +72,8 @@ test('test basic auth - username/password', async (t) => {
}
}
};
// Need to stub the config loader for these tests
const stubbedConfig = (client) => {
t.fail('this should not be called ');
};

const openshiftRestClient = proxyquire('../lib/openshift-rest-client', {
'kubernetes-client': {
config: {
fromKubeconfig: stubbedConfig
}
},
'./basic-auth-request': {
getTokenFromBasicAuth: (options) => {
t.equal(options.user, settings.config.auth.username);
Expand All @@ -120,17 +100,8 @@ test('test basic auth - user/pass', async (t) => {
insecureSkipTlsVerify: true
}
};
// Need to stub the config loader for these tests
const stubbedConfig = (client) => {
t.fail('this should not be called ');
};

const openshiftRestClient = proxyquire('../lib/openshift-rest-client', {
'kubernetes-client': {
config: {
fromKubeconfig: stubbedConfig
}
},
'./basic-auth-request': {
getTokenFromBasicAuth: (options) => {
t.equal(options.user, settings.config.auth.user);
Expand All @@ -154,17 +125,8 @@ test('test different config', async (t) => {
insecureSkipTlsVerify: true
}
};
// Need to stub the config loader for these tests
const stubbedConfig = (client) => {
t.fail('this should not be called ');
};

const openshiftRestClient = proxyquire('../lib/openshift-rest-client', {
'kubernetes-client': {
config: {
fromKubeconfig: stubbedConfig
}
},
'./basic-auth-request': {
getTokenFromBasicAuth: (options) => {
t.fail();
Expand All @@ -186,17 +148,8 @@ test('test different config with auth and no user/username', async (t) => {
insecureSkipTlsVerify: true
}
};
// Need to stub the config loader for these tests
const stubbedConfig = (client) => {
t.fail('this should not be called ');
};

const openshiftRestClient = proxyquire('../lib/openshift-rest-client', {
'kubernetes-client': {
config: {
fromKubeconfig: stubbedConfig
}
},
'./basic-auth-request': {
getTokenFromBasicAuth: (options) => {
t.fail();
Expand Down

0 comments on commit b103559

Please sign in to comment.