@@ -808,11 +808,12 @@ t.test('saving the ideal tree', t => {
808808 dependencies : {
809809 a : 'git+ssh://git@github.com:foo/bar#baz' ,
810810 b : '' ,
811- d : 'd@ npm:c@1.x <1.9.9' ,
811+ d : 'npm:c@1.x <1.9.9' ,
812812 // XXX: should we remove dependencies that are also workspaces?
813813 e : 'file:e' ,
814814 f : 'git+https://user:pass@github.com/baz/quux#asdf' ,
815815 g : '' ,
816+ h : '~1.2.3' ,
816817 } ,
817818 devDependencies : {
818819 c : `git+ssh://git@githost.com:a/b/c.git#master` ,
@@ -891,6 +892,16 @@ t.test('saving the ideal tree', t => {
891892 } ,
892893 parent : tree ,
893894 } )
895+ new Node ( {
896+ name : 'h' ,
897+ resolved : 'https://registry.npmjs.org/h/-/h-1.2.3.tgz' ,
898+ pkg : {
899+ name : 'h' ,
900+ version : '1.2.3' ,
901+ } ,
902+ parent : tree ,
903+ } )
904+
894905 const target = new Node ( {
895906 name : 'e' ,
896907 pkg : {
@@ -917,12 +928,11 @@ t.test('saving the ideal tree', t => {
917928 npa ( 'e' ) ,
918929 npa ( 'f@git+https://user:pass@github.com/baz/quux#asdf' ) ,
919930 npa ( 'g' ) ,
931+ npa ( 'h@~1.2.3' ) ,
920932 ]
921933 // NB: these are all going to be marked as extraneous, because we're
922934 // skipping the actual buildIdealTree step that flags them properly
923- return a [ kSaveIdealTree ] ( {
924- savePrefix : '~' ,
925- } )
935+ return a [ kSaveIdealTree ] ( { } )
926936 } ) . then ( ( ) => {
927937 t . matchSnapshot ( require ( path + '/package-lock.json' ) , 'lock after save' )
928938 t . strictSame ( require ( path + '/package.json' ) , {
@@ -934,6 +944,7 @@ t.test('saving the ideal tree', t => {
934944 e : 'file:e' ,
935945 f : 'git+https://user:pass@github.com/baz/quux.git#asdf' ,
936946 g : '*' ,
947+ h : '~1.2.3' ,
937948 } ,
938949 workspaces : [
939950 'e' ,
0 commit comments