-
-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathtest.js
24 lines (22 loc) · 1017 Bytes
/
test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import test from 'ava';
import semverDiff from './index.js';
test('main', t => {
t.is(semverDiff('0.0.1', '1.0.0'), 'major');
t.is(semverDiff('0.0.1', '0.1.0'), 'minor');
t.is(semverDiff('0.0.1', '0.0.2'), 'patch');
t.is(semverDiff('0.0.1-foo', '1.0.0'), 'premajor');
t.is(semverDiff('0.0.1-foo', '0.1.0'), 'preminor');
t.is(semverDiff('1.1.1-foo', '1.1.2'), 'prepatch');
t.is(semverDiff('0.0.1-foo', '0.0.1-foo.bar'), 'prerelease');
t.is(semverDiff('0.0.1', '0.0.1'), undefined);
t.is(semverDiff('0.0.2', '0.0.1'), undefined);
t.is(semverDiff('0.0.1', '0.0.1+foo.bar'), 'build');
t.is(semverDiff('0.0.1+0', '0.0.1'), undefined);
t.is(semverDiff('0.0.1+2', '0.0.1+2'), undefined);
t.is(semverDiff('0.0.1+3', '0.0.1+2'), undefined);
t.is(semverDiff('0.0.1+1', '0.0.1+2'), 'build');
t.is(semverDiff('0.0.1+2', '0.0.1+2.0'), 'build');
t.is(semverDiff('0.0.1+2.0', '0.0.1+2'), undefined);
t.is(semverDiff('0.0.1+2.a', '0.0.1+2.0'), undefined);
t.is(semverDiff('0.0.1+2.0', '0.0.1+2.a'), 'build');
});