forked from webpack/webpack-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.test.ts
46 lines (36 loc) · 1.53 KB
/
index.test.ts
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import { informationType } from "../index";
describe("infoSystem", () => {
it("should return the information of the system", async () => {
const returnedInformation = informationType("system");
const expectedInformation = { System: ["OS", "CPU", "Memory"] };
expect(returnedInformation).toEqual(expectedInformation);
});
});
describe("infoBinaries", () => {
it("should return the information of the binaries", async () => {
const returnedInformation = informationType("binaries");
const expectedInformation = { Binaries: ["Node", "Yarn", "npm"] };
expect(returnedInformation).toEqual(expectedInformation);
});
});
describe("infoBrowsers", () => {
it("should return the information of the browsers installed", async () => {
const returnedInformation = informationType("browsers");
const expectedInformation = { Browsers: ["Chrome", "Firefox", "Safari"] };
expect(returnedInformation).toEqual(expectedInformation);
});
});
describe("infoNpmGlobal", () => {
it("should return the information of the NPM global packages", async () => {
const returnedInformation = informationType("npmg");
const expectedInformation = { npmGlobalPackages: ["webpack", "webpack-cli"] };
expect(returnedInformation).toEqual(expectedInformation);
});
});
describe("infoNpm", () => {
it("should return the information of the NPM packages (webpack)", async () => {
const returnedInformation = informationType("npm");
const expectedInformation = { npmPackages: "*webpack*" };
expect(returnedInformation).toEqual(expectedInformation);
});
});