insomnia/packages/insomnia-smoke-test/fixtures/constants.ts
Opender Singh 5fa8f0069d
Enable ESLint & TS for smoke tests (#3397)
* remove babel and add configs

* add ts-node

* lint scripts

* eslint override

* remove type module

* add expect errors

* update js files to ts

* fix electron import

* remove errors

* update readme

* add build step

* typesync

* add eslintignore
2021-05-19 07:49:48 -04:00

14 lines
394 B
TypeScript

const getCreds = (user, pass, encoding) => ({
raw: { user, pass },
encoded: {
user: Buffer.from(user, encoding).toString(),
pass: Buffer.from(pass, encoding).toString(),
},
combined: Buffer.from(`${user}:${pass}`, encoding).toString('base64'),
});
export const basicAuthCreds = {
utf8: getCreds('user', 'pass', 'utf8'),
latin1: getCreds('user-é', 'pass-é', 'latin1'),
};