-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(bazel): integration test rule not able to setup mappings for reso…
…lutions (#286) Fixes that the Bazel integration test rule is not able to setup mappings for Yarn resolutions because the record keys do not exactly match to a package name, but rather follow certain allowed patterns, like `**/<pkg-name>`.
- Loading branch information
1 parent
4f0f6a0
commit ff39f60
Showing
3 changed files
with
73 additions
and
8 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,19 @@ | ||
import fakePkg from 'fake_pkg'; | ||
import fs from 'fs'; | ||
|
||
// Sanity check that the installed package matches the one we have | ||
// built from source using `pkg_npm`. | ||
if (fakePkg !== 'This is a fake package!') { | ||
console.error('Fake package is not matching with locally-built one.'); | ||
process.exitCode = 1; | ||
} | ||
|
||
const pkgJson = JSON.parse(fs.readFileSync('./package.json', 'utf8')); | ||
const recordsToCheck = ['dependencies', 'devDependencies', 'optionalDependencies', 'resolutions']; | ||
|
||
for (const recordName of recordsToCheck) { | ||
if (Object.values(pkgJson[recordName]).includes('0.0.0')) { | ||
console.error(`The "${recordName}" field has not been replaced with mapped archives.`); | ||
process.exitCode = 1; | ||
} | ||
} |