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