File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change 1- const { getPackageJson } = require ( "./utils" ) ;
1+ const { getPackageJson, isModuleInstalled , doesNotThrow } = require ( "./utils" ) ;
22const assert = require ( "assert" ) ;
33
44describe ( "package.json" , ( ) => {
@@ -54,4 +54,21 @@ describe("package.json", () => {
5454 'should have a "version" value that is a string'
5555 ) ;
5656 } ) ;
57+ // 2.1
58+ it ( 'should have "dependencies"' , ( ) => {
59+ assert . ok ( json . dependencies , '"dependencies" is missing' ) ;
60+ assert . equal (
61+ typeof json . dependencies ,
62+ "object" ,
63+ 'should have a "dependencies" value that is an object'
64+ ) ;
65+ } ) ;
66+ it ( 'should have installed "moment"' , async ( ) => {
67+ assert . ok (
68+ await doesNotThrow (
69+ ( ) => isModuleInstalled ( { name : "moment" , type : "dependency" } ) ,
70+ '"moment" not installed'
71+ )
72+ ) ;
73+ } ) ;
5774} ) ;
You can’t perform that action at this time.
0 commit comments