-
-
Notifications
You must be signed in to change notification settings - Fork 168
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add hash, scope and deps to dart (#1564)
* update pubspec to version which includes sha256 Signed-off-by: Paul <[email protected]> * update parsing of dart lock file to include hash, scope and bomref. Signed-off-by: Paul <[email protected]> * move assignment of bom ref Signed-off-by: Paul <[email protected]> --------- Signed-off-by: Paul <[email protected]>
- Loading branch information
1 parent
7a2c5d9
commit b39709f
Showing
4 changed files
with
162 additions
and
88 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 |
---|---|---|
|
@@ -2075,13 +2075,28 @@ test("get crates metadata", async () => { | |
|
||
test("parse pub lock", async () => { | ||
expect(await parsePubLockData(null)).toEqual([]); | ||
let dep_list = await parsePubLockData( | ||
const ret_val = await parsePubLockData( | ||
readFileSync("./test/data/pubspec.lock", { encoding: "utf-8" }), | ||
); | ||
expect(dep_list.length).toEqual(26); | ||
const root_list = ret_val.rootList; | ||
let dep_list = ret_val.pkgList; | ||
expect(dep_list.length).toEqual(28); | ||
expect(dep_list[0]).toEqual({ | ||
name: "async", | ||
version: "2.8.2", | ||
version: "2.11.0", | ||
_integrity: | ||
"sha256-947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c", | ||
"bom-ref": "pkg:dart/[email protected]", | ||
scope: "required", | ||
}); | ||
expect(root_list.length).toEqual(3); | ||
expect(root_list[0]).toEqual({ | ||
name: "flare_flutter", | ||
version: "3.0.2", | ||
_integrity: | ||
"sha256-99d63c60f00fac81249ce6410ee015d7b125c63d8278a30da81edf3317a1f6a0", | ||
"bom-ref": "pkg:dart/[email protected]", | ||
scope: "required", | ||
}); | ||
dep_list = parsePubYamlData( | ||
readFileSync("./test/data/pubspec.yaml", { encoding: "utf-8" }), | ||
|
Oops, something went wrong.