1import { ensureSlash, getEntryPointWithExtensions } from '../paths'; 2 3// TODO: Bacon: Add test for resolving entry point 4// TODO: Bacon: Add test for custom config paths 5 6describe(ensureSlash, () => { 7 it(`ensures the ending slash is added`, () => { 8 expect(ensureSlash('', true)).toBe('/'); 9 expect(ensureSlash('/', true)).toBe('/'); 10 }); 11 it(`ensures the ending slash is removed`, () => { 12 expect(ensureSlash('', false)).toBe(''); 13 expect(ensureSlash('/', false)).toBe(''); 14 }); 15}); 16 17describe(getEntryPointWithExtensions, () => { 18 // Allow legacy versions to continue to use the getEntry without the last argument 'mode' 19 it(`doesn't throw when mode isn't defined`, () => { 20 // Test that it throws the error after the config error. 21 // This error is thrown because the mock FS isn't implemented. 22 expect(() => getEntryPointWithExtensions('/', [], [])).toThrow( 23 `The expected package.json path: /package.json does not exist` 24 ); 25 }); 26}); 27 28// getEntryPoint; 29