-
-
Notifications
You must be signed in to change notification settings - Fork 299
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
293 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
integration-tests/partial-apply/__snapshots__/partial-apply.test.ts.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`Test partial-apply: 00: patch-package fails when one of the patches in the sequence fails 1`] = ` | ||
"SNAPSHOT: patch-package fails when one of the patches in the sequence fails | ||
patch-package 0.0.0 | ||
Applying patches... | ||
[email protected] (1 hello) ✔ | ||
⛔ ERROR | ||
Failed to apply patch file left-pad+1.3.0+002+world.patch. | ||
If this patch file is no longer useful, delete it and run | ||
patch-package | ||
To partially apply the patch (if possible) and output a log of errors to fix, run | ||
patch-package --partial | ||
After which you should make any required changes inside node_modules/left-pad, and finally run | ||
patch-package left-pad | ||
to update the patch file. | ||
END SNAPSHOT" | ||
`; | ||
|
||
exports[`Test partial-apply: 01: patch-package --partial saves a log 1`] = ` | ||
"SNAPSHOT: patch-package --partial saves a log | ||
patch-package 0.0.0 | ||
Applying patches... | ||
[email protected] (1 hello) ✔ | ||
Saving errors to ./patch-package-errors.log | ||
patch-package-errors.log | ||
Cannot apply hunk 0 for file node_modules/left-pad/index.js | ||
\`\`\`diff | ||
@@ -3,7 +3,7 @@ | ||
* and/or modify it under the terms of the Do What The Fuck You Want | ||
* To Public License, Version 2, as published by Sam Hocevar. See | ||
* http://www.wtfpl.net/ for more details. */ | ||
-'use oops'; | ||
+'use world'; | ||
module.exports = leftPad; | ||
var cache = [ | ||
\`\`\` | ||
END SNAPSHOT" | ||
`; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"name": "partial-apply", | ||
"version": "1.0.0", | ||
"description": "integration test for patch-package", | ||
"main": "index.js", | ||
"author": "", | ||
"license": "ISC", | ||
"dependencies": { | ||
"left-pad": "^1.3.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/bin/bash | ||
# make sure errors stop the script | ||
set -e | ||
|
||
npm install | ||
|
||
echo "add patch-package" | ||
npm add $1 | ||
|
||
function patch-package { | ||
./node_modules/.bin/patch-package "$@" | ||
} | ||
|
||
echo "SNAPSHOT: patch-package fails when one of the patches in the sequence fails" | ||
if patch-package | ||
then | ||
exit 1 | ||
fi | ||
echo "END SNAPSHOT" | ||
|
||
|
||
echo "SNAPSHOT: patch-package --partial saves a log" | ||
patch-package --partial | ||
echo 'patch-package-errors.log' | ||
cat patch-package-errors.log | ||
echo "END SNAPSHOT" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { runIntegrationTest } from "../runIntegrationTest" | ||
runIntegrationTest({ | ||
projectName: "partial-apply", | ||
shouldProduceSnapshots: true, | ||
}) |
13 changes: 13 additions & 0 deletions
13
integration-tests/partial-apply/patches/left-pad+1.3.0+001+hello.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
diff --git a/node_modules/left-pad/index.js b/node_modules/left-pad/index.js | ||
index e90aec3..1a2ec5f 100644 | ||
--- a/node_modules/left-pad/index.js | ||
+++ b/node_modules/left-pad/index.js | ||
@@ -3,7 +3,7 @@ | ||
* and/or modify it under the terms of the Do What The Fuck You Want | ||
* To Public License, Version 2, as published by Sam Hocevar. See | ||
* http://www.wtfpl.net/ for more details. */ | ||
-'use strict'; | ||
+'use hello'; | ||
module.exports = leftPad; | ||
|
||
var cache = [ |
13 changes: 13 additions & 0 deletions
13
integration-tests/partial-apply/patches/left-pad+1.3.0+002+world.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
diff --git a/node_modules/left-pad/index.js b/node_modules/left-pad/index.js | ||
index 1a2ec5f..5aa41be 100644 | ||
--- a/node_modules/left-pad/index.js | ||
+++ b/node_modules/left-pad/index.js | ||
@@ -3,7 +3,7 @@ | ||
* and/or modify it under the terms of the Do What The Fuck You Want | ||
* To Public License, Version 2, as published by Sam Hocevar. See | ||
* http://www.wtfpl.net/ for more details. */ | ||
-'use oops'; | ||
+'use world'; | ||
module.exports = leftPad; | ||
|
||
var cache = [ |
13 changes: 13 additions & 0 deletions
13
integration-tests/partial-apply/patches/left-pad+1.3.0+003+goodbye.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
diff --git a/node_modules/left-pad/index.js b/node_modules/left-pad/index.js | ||
index 5aa41be..5ee751b 100644 | ||
--- a/node_modules/left-pad/index.js | ||
+++ b/node_modules/left-pad/index.js | ||
@@ -3,7 +3,7 @@ | ||
* and/or modify it under the terms of the Do What The Fuck You Want | ||
* To Public License, Version 2, as published by Sam Hocevar. See | ||
* http://www.wtfpl.net/ for more details. */ | ||
-'use world'; | ||
+'goodbye world'; | ||
module.exports = leftPad; | ||
|
||
var cache = [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.