forked from babel/babel
/
pretty.spec.js
32 lines (29 loc) · 850 Bytes
/
pretty.spec.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
25
26
27
28
29
30
31
32
import { prettifyTargets, prettifyVersion } from "../lib/pretty.js";
describe("pretty", () => {
describe("prettifyVersion", () => {
it("returns", () => {
expect(prettifyVersion(true)).toBe(true);
expect(prettifyVersion("0.16.0")).toBe("0.16");
expect(prettifyVersion("1.0.0")).toBe("1");
expect(prettifyVersion("1.1.0")).toBe("1.1");
expect(prettifyVersion("1.0.2")).toBe("1.0.2");
expect(prettifyVersion("1.2.3")).toBe("1.2.3");
});
});
describe("prettifyTargets", () => {
it("returns", () => {
expect(prettifyTargets({})).toEqual({});
expect(
prettifyTargets({
chrome: "54.0.0",
electron: "1.6.0",
node: "0.12.0",
}),
).toEqual({
chrome: "54",
electron: "1.6",
node: "0.12",
});
});
});
});