Stubs stubs = Stubs.getDefault();
assertNotNull( stubs );
FileObject actualHttp = stubs.getStubs( null ).getRoot().getFileObject( "http.js" );
assertNotNull( actualHttp );
NodeJSUtils utils = NodeJSUtils.getDefault();
assertNotNull( utils );
FileObject index = prj.getProjectDirectory().getFileObject( "index.js" );
assertNotNull( index );
FileObject other = utils.resolve( "./other", index );
assertNotNull( other );
assertEquals( "other.js", other.getNameExt() );
assertEquals( index.getParent(), other.getParent() );
FileObject http = utils.resolve( "http", index );
assertNotNull( http );
assertEquals( actualHttp, http );
LibrariesChildFactory f = new LibrariesChildFactory( prj );
Set<String> libs = new HashSet<>();
for (ProjectNodeKey key : f.libraries()) {
libs.add( key.toString() );
if (!"boo".equals( key.toString() )) {
assertTrue( key.isBuiltIn() );
} else {
assertFalse( key.isBuiltIn() );
}
}
assertTrue( libs.contains( "util" ) );
assertTrue( libs.contains( "fs" ) );
assertTrue( libs.contains( "http" ) );
assertFalse( libs.contains( "url" ) );
assertTrue( libs.contains( "boo" ) );
FileObject boo = utils.resolve( "boo", index );
assertNotNull( boo );
assertEquals( booDir.getFileObject( "boo.js" ), boo );
NodeJSProjectProperties props = prj.getLookup().lookup( NodeJSProjectProperties.class );
assertNotNull( props );