Skip to content

Commit 1c9104c

Browse files
committed
add initial rebase tests
1 parent ec0e69c commit 1c9104c

27 files changed

+960
-268
lines changed

integration-tests/newIntegrationTest.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ fs.writeFileSync(
3030
`,
3131
)
3232

33-
spawnSafeSync("yarn", [], { cwd: testDir })
33+
spawnSafeSync("npm", ["i"], { cwd: testDir })
3434

3535
// create shell script boilerplate
3636
fs.writeFileSync(
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
// Jest Snapshot v1, https://goo.gl/fbAQLP
2+
3+
exports[`Test rebase-fast-forward-failures: 00: when continuing the rebase, the final patch should fail to apply because it's out of date 1`] = `
4+
"SNAPSHOT: when continuing the rebase, the final patch should fail to apply because it's out of date
5+
patch-package 0.0.0
6+
• Creating temporary folder
7+
• Installing [email protected] with npm
8+
• Diffing your files with clean files
9+
✔ Created file patches/left-pad+1.3.0+002+world.patch
10+
11+
Fast forwarding...
12+
13+
⛔ ERROR
14+
15+
Failed to apply patch file left-pad+1.3.0+003+goodbye.patch.
16+
17+
If this patch file is no longer useful, delete it and run
18+
19+
patch-package
20+
21+
Otherwise you should open node_modules/left-pad, manually apply the changes from the patch file, and run
22+
23+
patch-package left-pad
24+
25+
to update the patch file.
26+
27+
END SNAPSHOT"
28+
`;
29+
30+
exports[`Test rebase-fast-forward-failures: 01: when continuing the rebase, the final patch should apply 1`] = `
31+
"SNAPSHOT: when continuing the rebase, the final patch should apply
32+
patch-package 0.0.0
33+
• Creating temporary folder
34+
• Installing [email protected] with npm
35+
• Diffing your files with clean files
36+
✔ Created file patches/left-pad+1.3.0+003+goodbye.patch
37+
38+
END SNAPSHOT"
39+
`;
40+
41+
exports[`Test rebase-fast-forward-failures: 02: the patches should go from 'use strict' to 'use hello' to 'use universe' to 'goodbye universe' 1`] = `
42+
"SNAPSHOT: the patches should go from 'use strict' to 'use hello' to 'use universe' to 'goodbye universe'
43+
diff --git a/node_modules/left-pad/index.js b/node_modules/left-pad/index.js
44+
index e90aec3..1a2ec5f 100644
45+
--- a/node_modules/left-pad/index.js
46+
+++ b/node_modules/left-pad/index.js
47+
@@ -3,7 +3,7 @@
48+
* and/or modify it under the terms of the Do What The Fuck You Want
49+
* To Public License, Version 2, as published by Sam Hocevar. See
50+
* http://www.wtfpl.net/ for more details. */
51+
-'use strict';
52+
+'use hello';
53+
module.exports = leftPad;
54+
55+
var cache = [
56+
diff --git a/node_modules/left-pad/index.js b/node_modules/left-pad/index.js
57+
index 1a2ec5f..f2e3912 100644
58+
--- a/node_modules/left-pad/index.js
59+
+++ b/node_modules/left-pad/index.js
60+
@@ -3,7 +3,7 @@
61+
* and/or modify it under the terms of the Do What The Fuck You Want
62+
* To Public License, Version 2, as published by Sam Hocevar. See
63+
* http://www.wtfpl.net/ for more details. */
64+
-'use hello';
65+
+'use universe';
66+
module.exports = leftPad;
67+
68+
var cache = [
69+
diff --git a/node_modules/left-pad/index.js b/node_modules/left-pad/index.js
70+
index f2e3912..a02f494 100644
71+
--- a/node_modules/left-pad/index.js
72+
+++ b/node_modules/left-pad/index.js
73+
@@ -3,7 +3,7 @@
74+
* and/or modify it under the terms of the Do What The Fuck You Want
75+
* To Public License, Version 2, as published by Sam Hocevar. See
76+
* http://www.wtfpl.net/ for more details. */
77+
-'use universe';
78+
+'goodbye universe';
79+
module.exports = leftPad;
80+
81+
var cache = [
82+
END SNAPSHOT"
83+
`;

0 commit comments

Comments
 (0)