botbook/node_modules/@pnpm/network.ca-file/ca-file.spec.ts

21 lines
546 B
TypeScript
Raw Normal View History

2024-09-04 13:13:15 -03:00
import path from 'path'
import { readCAFileSync } from './ca-file';
it('should read CA file', () => {
expect(readCAFileSync(path.join(__dirname, 'fixtures/ca-file1.txt'))).toStrictEqual([
`-----BEGIN CERTIFICATE-----
XXXX
-----END CERTIFICATE-----`,
`-----BEGIN CERTIFICATE-----
YYYY
-----END CERTIFICATE-----`,
`-----BEGIN CERTIFICATE-----
ZZZZ
-----END CERTIFICATE-----`,
]);
});
it('should not fail when the file does not exist', () => {
expect(readCAFileSync(path.join(__dirname, 'not-exists.txt'))).toEqual(undefined)
})