@platform/react.ssr
Version:
A lightweight SSR (server-side-rendering) system for react apps bundled with ParcelJS and hosted on S3.
18 lines (17 loc) • 579 B
JavaScript
import { expect } from '../test';
import * as util from './util';
describe('util', () => {
it('firstSemver', () => {
const test = (input, expected) => {
const res = util.firstSemver(...input);
expect(res).to.eql(expected);
};
test([], undefined);
test([undefined], undefined);
test(['foo', 'bar'], undefined);
test(['1.2.3'], '1.2.3');
test([undefined, '1.2.3'], '1.2.3');
test([undefined, 'foo', '1.2.3'], '1.2.3');
test(['/bundle/1.2.3-alpha.1'], '1.2.3-alpha.1');
});
});