dependabot-npm_and_yarn 0.133.4 → 0.134.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,10 +0,0 @@
1
- {
2
- "name": "test",
3
- "version": "1.0.0",
4
- "private": true,
5
- "dependencies": {
6
- "react": "0.14.9",
7
- "react-modal": "0.6.1",
8
- "react-tabs": "1.1.0"
9
- }
10
- }
@@ -1,21 +0,0 @@
1
- const path = require("path");
2
- const fs = require("fs");
3
-
4
- module.exports = {
5
- loadFixture: (fixturePath) =>
6
- fs.readFileSync(path.join(__dirname, "fixtures", fixturePath)).toString(),
7
-
8
- copyDependencies: (sourceDir, destDir) => {
9
- const srcPackageJson = path.join(
10
- __dirname,
11
- `fixtures/${sourceDir}/package.json`
12
- );
13
- fs.copyFileSync(srcPackageJson, `${destDir}/package.json`);
14
-
15
- const srcLockfile = path.join(
16
- __dirname,
17
- `fixtures/${sourceDir}/package-lock.json`
18
- );
19
- fs.copyFileSync(srcLockfile, `${destDir}/package-lock.json`);
20
- },
21
- };
@@ -1,107 +0,0 @@
1
- const path = require("path");
2
- const os = require("os");
3
- const fs = require("fs");
4
- const rimraf = require("rimraf");
5
- const {
6
- checkPeerDependencies,
7
- } = require("../../lib/npm7/peer-dependency-checker");
8
- const helpers = require("./helpers");
9
-
10
- describe("checkPeerDependencies", () => {
11
- let tempDir;
12
- beforeEach(() => {
13
- tempDir = fs.mkdtempSync(os.tmpdir() + path.sep);
14
- });
15
- afterEach(() => rimraf.sync(tempDir));
16
-
17
- it("updating a dependency with a peer requirement", async () => {
18
- helpers.copyDependencies(
19
- "peer-dependency-checker/peer_dependency",
20
- tempDir
21
- );
22
-
23
- await expect(
24
- checkPeerDependencies(tempDir, "react-dom", "16.14.0", [
25
- {
26
- file: "package.json",
27
- requirement: "16.14.0",
28
- groups: ["dependencies"],
29
- source: null,
30
- },
31
- ])
32
- ).rejects.toThrow(
33
- "react-dom@16.14.0 requires a peer of react@^16.14.0 but none is installed."
34
- );
35
- });
36
-
37
- it("updating a dependency that is a peer requirement", async () => {
38
- helpers.copyDependencies(
39
- "peer-dependency-checker/peer_dependency",
40
- tempDir
41
- );
42
-
43
- await expect(
44
- checkPeerDependencies(tempDir, "react", "16.14.0", [
45
- {
46
- file: "package.json",
47
- requirement: "16.14.0",
48
- groups: ["dependencies"],
49
- source: null,
50
- },
51
- ])
52
- ).rejects.toThrow(
53
- "react-dom@15.2.0 requires a peer of react@^15.2.0 but none is installed."
54
- );
55
- });
56
-
57
- it("updating a dependency that is a peer requirement of multiple dependencies", async () => {
58
- helpers.copyDependencies(
59
- "peer-dependency-checker/peer_dependency_multiple",
60
- tempDir
61
- );
62
-
63
- await expect(
64
- checkPeerDependencies(
65
- tempDir,
66
- "react",
67
- "0.14.2",
68
- [
69
- {
70
- file: "package.json",
71
- requirement: "0.14.2",
72
- groups: ["dependencies"],
73
- source: null,
74
- },
75
- ],
76
- [
77
- {
78
- name: "react",
79
- version: "15.2.0",
80
- requirements: [
81
- {
82
- file: "package.json",
83
- requirement: "15.2.0",
84
- groups: ["dependencies"],
85
- source: null,
86
- },
87
- ],
88
- },
89
- {
90
- name: "react-dom",
91
- version: "15.2.0",
92
- requirements: [
93
- {
94
- file: "package.json",
95
- requirement: "15.2.0",
96
- groups: ["dependencies"],
97
- source: null,
98
- },
99
- ],
100
- },
101
- ]
102
- )
103
- ).rejects.toThrow(
104
- "react-tabs@1.1.0 requires a peer of react@^0.14.9 || ^15.3.0 but none is installed."
105
- );
106
- });
107
- });