Skip to content

Commit ae36609

Browse files
committed
fix: remove tests, point directly to npm config settings for ca and StrictSSL
1 parent d264f0b commit ae36609

File tree

2 files changed

+3
-28
lines changed

2 files changed

+3
-28
lines changed

standalone/install.spec.ts

+1-22
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import * as fs from 'fs';
55
import * as path from 'path';
66
import * as chai from 'chai';
7-
import { BinaryEntry, Config, useStrictSSL } from './install';
7+
import { BinaryEntry, Config } from './install';
88

99
const expect = chai.expect;
1010

@@ -19,27 +19,6 @@ describe('Install', () => {
1919
}
2020
});
2121

22-
describe('#useStrictSSL', () => {
23-
afterEach(() => {
24-
delete process.env['npm_config_strict-ssl']
25-
})
26-
describe('when "strict-ssl" is specified in an NPM configuration', () => {
27-
it('returns a true', () => {
28-
process.env['npm_config_strict-ssl'] = "true"
29-
expect(useStrictSSL()).to.be.true
30-
})
31-
it('returns a false', () => {
32-
process.env['npm_config_strict-ssl'] = "false"
33-
expect(useStrictSSL()).to.be.false
34-
})
35-
})
36-
describe('when "strict-ssl" is not specified in any NPM configuration', () => {
37-
it('returns true', () => {
38-
expect(useStrictSSL()).to.be.true
39-
})
40-
})
41-
})
42-
4322
function createConfig(): Config {
4423
return require('./install').createConfig();
4524
}

standalone/install.ts

+2-6
Original file line numberDiff line numberDiff line change
@@ -144,11 +144,6 @@ const CIs = [
144144
'WERCKER_ROOT',
145145
];
146146

147-
export function useStrictSSL(): boolean {
148-
const prop = config.read()['strict-ssl']
149-
return prop === "true" || prop === undefined || prop === ""
150-
}
151-
152147
function downloadFileRetry(
153148
url: string,
154149
filepath: string,
@@ -164,7 +159,8 @@ function downloadFileRetry(
164159
headers: {
165160
'User-Agent': 'https://github.com/pact-foundation/pact-node',
166161
},
167-
strictSSL: useStrictSSL()
162+
strictSSL: config.read()['strict-ssl'],
163+
ca: config.read()['cafile'],
168164
})
169165
.on('error', (e: string) => reject(e))
170166
.on(

0 commit comments

Comments
 (0)