mirror of
https://github.com/verdaccio/verdaccio.git
synced 2024-12-23 22:27:34 -05:00
31 lines
859 B
TypeScript
31 lines
859 B
TypeScript
import { Logger } from '@verdaccio/types';
|
|
|
|
import ProxyAudit, { ConfigAudit } from '../src/index';
|
|
|
|
const config: ConfigAudit = {
|
|
enabled: true,
|
|
} as ConfigAudit;
|
|
|
|
const logger: Logger = {
|
|
error: (e) => console.warn(e),
|
|
info: (e) => console.warn(e),
|
|
debug: (e) => console.warn(e),
|
|
child: (e) => console.warn(e),
|
|
warn: () => {},
|
|
http: (e) => console.warn(e),
|
|
trace: (e) => console.warn(e),
|
|
};
|
|
|
|
describe('Audit plugin', () => {
|
|
test('should test audit', () => {
|
|
const audit = new ProxyAudit(config, { logger, config: undefined });
|
|
expect(audit).toBeDefined();
|
|
});
|
|
|
|
test('should test audit with configuration', () => {
|
|
const config = { strict_ssl: false } as ConfigAudit;
|
|
const audit = new ProxyAudit(config, { logger, config: config });
|
|
expect(audit).toBeDefined();
|
|
expect(audit.strict_ssl).toBeFalsy();
|
|
});
|
|
});
|