use webpack for all builds

This commit is contained in:
Shawn Erquhart
2018-07-17 19:13:52 -04:00
parent 040dd6859c
commit 2f95d8c4fc
96 changed files with 2886 additions and 2068 deletions

View File

@ -0,0 +1,101 @@
import { fileExtensionWithSeparator, fileExtension } from '../path';
describe('fileExtensionWithSeparator', () => {
it('should return the extension of a file', () => {
expect(
fileExtensionWithSeparator('index.html')
).toEqual(
'.html'
);
});
it('should return the extension of a file path', () => {
expect(
fileExtensionWithSeparator('/src/main/index.html')
).toEqual(
'.html'
);
});
it('should return the extension of a file path with trailing slash', () => {
expect(
fileExtensionWithSeparator('/src/main/index.html/')
).toEqual(
'.html'
);
});
it('should return the extension for an extension with two ..', () => {
expect(
fileExtensionWithSeparator('/src/main/index..html')
).toEqual(
'.html'
);
});
it('should return an empty string for the parent path ..', () => {
expect(
fileExtensionWithSeparator('..')
).toEqual(
''
);
});
it('should return an empty string if the file has no extension', () => {
expect(
fileExtensionWithSeparator('/src/main/index')
).toEqual(
''
);
});
});
describe('fileExtension', () => {
it('should return the extension of a file', () => {
expect(
fileExtension('index.html')
).toEqual(
'html'
);
});
it('should return the extension of a file path', () => {
expect(
fileExtension('/src/main/index.html')
).toEqual(
'html'
);
});
it('should return the extension of a file path with trailing slash', () => {
expect(
fileExtension('/src/main/index.html/')
).toEqual(
'html'
);
});
it('should return the extension for an extension with two ..', () => {
expect(
fileExtension('/src/main/index..html')
).toEqual(
'html'
);
});
it('should return an empty string for the parent path ..', () => {
expect(
fileExtension('..')
).toEqual(
''
);
});
it('should return an empty string if the file has no extension', () => {
expect(
fileExtension('/src/main/index')
).toEqual(
''
);
});
});

View File

@ -0,0 +1,7 @@
export APIError from './APIError';
export Cursor, { CURSOR_COMPATIBILITY_SYMBOL } from './Cursor';
export EditorialWorkflowError from './EditorialWorkflowError';
export localForage from './localForage';
export { resolvePath, basename, fileExtensionWithSeparator, fileExtension } from './path';
export { filterPromises, resolvePromiseProperties, then } from './promise';
export unsentRequest from './unsentRequest';