botbook/node_modules/@pnpm/npm-conf/lib/envKeyToSetting.test.js

47 lines
709 B
JavaScript
Raw Normal View History

2024-09-04 13:13:15 -03:00
const envKeyToSetting = require('./envKeyToSetting');
const fixtures = [
[
'FOO',
'foo',
],
[
'//npm.pkg.github.com/:_authToken',
'//npm.pkg.github.com/:_authToken',
],
[
'_authToken',
'_authToken',
],
[
'//npm.pkg.github.com/:_authtoken',
'//npm.pkg.github.com/:_authToken',
],
[
'_authtoken',
'_authToken',
],
[
'//npm.pkg.github.com/:_auth',
'//npm.pkg.github.com/:_auth',
],
[
'_auth',
'_auth',
],
[
'//npm.pkg.github.com/:_always_auth',
'//npm.pkg.github.com/:_always-auth',
],
[
'_always_auth',
'_always-auth',
],
];
test('envKeyToSetting()', () => {
for (const [key, expected] of fixtures) {
expect(envKeyToSetting(key)).toBe(expected);
}
})