2015-06-24 06:06:57 +02:00
/// <reference path="..\..\..\src\harness\external\mocha.d.ts" />
/// <reference path='..\..\..\src\harness\harness.ts' />
/// <reference path="..\..\..\src\harness\harnessLanguageService.ts" />
2016-05-24 19:17:16 +02:00
namespace ts {
2015-07-09 23:40:33 +02:00
const enum ChangedPart {
references = 1 << 0 ,
importsAndExports = 1 << 1 ,
program = 1 << 2
}
2016-05-24 19:17:16 +02:00
const newLine = "\r\n" ;
2015-07-09 23:40:33 +02:00
interface SourceFileWithText extends SourceFile {
sourceText? : SourceText ;
}
interface NamedSourceText {
name : string ;
2016-05-24 19:17:16 +02:00
text : SourceText ;
2015-07-09 23:40:33 +02:00
}
interface ProgramWithSourceTexts extends Program {
sourceTexts? : NamedSourceText [ ] ;
}
class SourceText implements IScriptSnapshot {
private fullText : string ;
constructor ( private references : string ,
private importsAndExports : string ,
private program : string ,
private changedPart : ChangedPart = 0 ,
private version = 0 ) {
}
static New ( references : string , importsAndExports : string , program : string ) : SourceText {
Debug . assert ( references !== undefined ) ;
Debug . assert ( importsAndExports !== undefined ) ;
Debug . assert ( program !== undefined ) ;
return new SourceText ( references + newLine , importsAndExports + newLine , program || "" ) ;
}
public getVersion ( ) : number {
return this . version ;
}
public updateReferences ( newReferences : string ) : SourceText {
Debug . assert ( newReferences !== undefined ) ;
return new SourceText ( newReferences + newLine , this . importsAndExports , this . program , this . changedPart | ChangedPart . references , this . version + 1 ) ;
}
public updateImportsAndExports ( newImportsAndExports : string ) : SourceText {
Debug . assert ( newImportsAndExports !== undefined ) ;
return new SourceText ( this . references , newImportsAndExports + newLine , this . program , this . changedPart | ChangedPart . importsAndExports , this . version + 1 ) ;
}
public updateProgram ( newProgram : string ) : SourceText {
Debug . assert ( newProgram !== undefined ) ;
return new SourceText ( this . references , this . importsAndExports , newProgram , this . changedPart | ChangedPart . program , this . version + 1 ) ;
}
public getFullText() {
return this . fullText || ( this . fullText = this . references + this . importsAndExports + this . program ) ;
}
public getText ( start : number , end : number ) : string {
return this . getFullText ( ) . substring ( start , end ) ;
}
getLength ( ) : number {
return this . getFullText ( ) . length ;
}
getChangeRange ( oldSnapshot : IScriptSnapshot ) : TextChangeRange {
2016-05-24 19:17:16 +02:00
const oldText = < SourceText > oldSnapshot ;
let oldSpan : TextSpan ;
let newLength : number ;
2015-07-09 23:40:33 +02:00
switch ( oldText . changedPart ^ this . changedPart ) {
case ChangedPart . references :
oldSpan = createTextSpan ( 0 , oldText . references . length ) ;
newLength = this . references . length ;
break ;
case ChangedPart . importsAndExports :
oldSpan = createTextSpan ( oldText . references . length , oldText . importsAndExports . length ) ;
2016-05-24 19:17:16 +02:00
newLength = this . importsAndExports . length ;
2015-07-09 23:40:33 +02:00
break ;
case ChangedPart . program :
oldSpan = createTextSpan ( oldText . references . length + oldText . importsAndExports . length , oldText . program . length ) ;
newLength = this . program . length ;
break ;
default :
Debug . assert ( false , "Unexpected change" ) ;
}
return createTextChangeRange ( oldSpan , newLength ) ;
}
}
function createTestCompilerHost ( texts : NamedSourceText [ ] , target : ScriptTarget ) : CompilerHost {
2016-05-24 19:17:16 +02:00
const files : Map < SourceFileWithText > = { } ;
for ( const t of texts ) {
const file = < SourceFileWithText > createSourceFile ( t . name , t . text . getFullText ( ) , target ) ;
2015-07-09 23:40:33 +02:00
file . sourceText = t . text ;
files [ t . name ] = file ;
}
2016-05-24 19:17:16 +02:00
2015-07-09 23:40:33 +02:00
return {
getSourceFile ( fileName ) : SourceFile {
return files [ fileName ] ;
} ,
getDefaultLibFileName ( ) : string {
2016-05-24 19:17:16 +02:00
return "lib.d.ts" ;
2015-07-09 23:40:33 +02:00
} ,
writeFile ( file , text ) {
throw new Error ( "NYI" ) ;
} ,
getCurrentDirectory ( ) : string {
return "" ;
} ,
2016-06-11 00:44:11 +02:00
getDirectories ( path : string ) : string [ ] {
return [ ] ;
} ,
2015-07-09 23:40:33 +02:00
getCanonicalFileName ( fileName ) : string {
2016-04-01 21:41:45 +02:00
return sys && sys . useCaseSensitiveFileNames ? fileName : fileName.toLowerCase ( ) ;
2015-07-09 23:40:33 +02:00
} ,
useCaseSensitiveFileNames ( ) : boolean {
2016-04-01 21:41:45 +02:00
return sys && sys . useCaseSensitiveFileNames ;
2015-07-09 23:40:33 +02:00
} ,
getNewLine ( ) : string {
2016-04-01 21:41:45 +02:00
return sys ? sys.newLine : newLine ;
2015-07-09 23:40:33 +02:00
} ,
2015-08-05 06:22:37 +02:00
fileExists : fileName = > hasProperty ( files , fileName ) ,
readFile : fileName = > {
2016-05-24 19:17:16 +02:00
const file = lookUp ( files , fileName ) ;
2015-08-05 06:22:37 +02:00
return file && file . text ;
}
2016-05-24 19:17:16 +02:00
} ;
2015-07-09 23:40:33 +02:00
}
function newProgram ( texts : NamedSourceText [ ] , rootNames : string [ ] , options : CompilerOptions ) : Program {
2016-05-24 19:17:16 +02:00
const host = createTestCompilerHost ( texts , options . target ) ;
const program = < ProgramWithSourceTexts > createProgram ( rootNames , options , host ) ;
2015-07-09 23:40:33 +02:00
program . sourceTexts = texts ;
return program ;
}
function updateProgram ( oldProgram : Program , rootNames : string [ ] , options : CompilerOptions , updater : ( files : NamedSourceText [ ] ) = > void ) {
2016-05-24 19:17:16 +02:00
const texts : NamedSourceText [ ] = ( < ProgramWithSourceTexts > oldProgram ) . sourceTexts . slice ( 0 ) ;
2015-07-09 23:40:33 +02:00
updater ( texts ) ;
2016-05-24 19:17:16 +02:00
const host = createTestCompilerHost ( texts , options . target ) ;
const program = < ProgramWithSourceTexts > createProgram ( rootNames , options , host , oldProgram ) ;
2015-07-09 23:40:33 +02:00
program . sourceTexts = texts ;
return program ;
}
function getSizeOfMap ( map : Map < any > ) : number {
let size = 0 ;
2016-05-24 19:17:16 +02:00
for ( const id in map ) {
2015-07-09 23:40:33 +02:00
if ( hasProperty ( map , id ) ) {
size ++ ;
}
}
return size ;
}
2016-04-01 21:41:45 +02:00
function checkResolvedModule ( expected : ResolvedModule , actual : ResolvedModule ) : void {
assert . isTrue ( actual !== undefined ) ;
assert . isTrue ( expected . resolvedFileName === actual . resolvedFileName , ` 'resolvedFileName': expected ' ${ expected . resolvedFileName } ' to be equal to ' ${ actual . resolvedFileName } ' ` ) ;
assert . isTrue ( expected . isExternalLibraryImport === actual . isExternalLibraryImport , ` 'isExternalLibraryImport': expected ' ${ expected . isExternalLibraryImport } ' to be equal to ' ${ actual . isExternalLibraryImport } ' ` ) ;
}
function checkResolvedTypeDirective ( expected : ResolvedTypeReferenceDirective , actual : ResolvedTypeReferenceDirective ) : void {
assert . isTrue ( actual !== undefined ) ;
assert . isTrue ( expected . resolvedFileName === actual . resolvedFileName , ` 'resolvedFileName': expected ' ${ expected . resolvedFileName } ' to be equal to ' ${ actual . resolvedFileName } ' ` ) ;
assert . isTrue ( expected . primary === actual . primary , ` 'primary': expected ' ${ expected . primary } ' to be equal to ' ${ actual . primary } ' ` ) ;
}
2016-05-24 19:17:16 +02:00
function checkCache < T > ( caption : string , program : Program , fileName : string , expectedContent : Map < T > , getCache : ( f : SourceFile ) = > Map < T > , entryChecker : ( expected : T , original : T ) = > void ) : void {
const file = program . getSourceFile ( fileName ) ;
2015-07-09 23:40:33 +02:00
assert . isTrue ( file !== undefined , ` cannot find file ${ fileName } ` ) ;
2016-05-24 19:17:16 +02:00
const cache = getCache ( file ) ;
2015-07-09 23:40:33 +02:00
if ( expectedContent === undefined ) {
2016-04-01 21:41:45 +02:00
assert . isTrue ( cache === undefined , ` expected ${ caption } to be undefined ` ) ;
2015-07-09 23:40:33 +02:00
}
else {
2016-04-01 21:41:45 +02:00
assert . isTrue ( cache !== undefined , ` expected ${ caption } to be set ` ) ;
2016-05-24 19:17:16 +02:00
const actualCacheSize = getSizeOfMap ( cache ) ;
const expectedSize = getSizeOfMap ( expectedContent ) ;
2015-07-09 23:40:33 +02:00
assert . isTrue ( actualCacheSize === expectedSize , ` expected actual size: ${ actualCacheSize } to be equal to ${ expectedSize } ` ) ;
2016-05-24 19:17:16 +02:00
for ( const id in expectedContent ) {
2015-07-09 23:40:33 +02:00
if ( hasProperty ( expectedContent , id ) ) {
2016-04-01 21:41:45 +02:00
2015-09-10 20:36:31 +02:00
if ( expectedContent [ id ] ) {
const expected = expectedContent [ id ] ;
2016-04-01 21:41:45 +02:00
const actual = cache [ id ] ;
entryChecker ( expected , actual ) ;
2015-09-10 20:36:31 +02:00
}
2015-07-09 23:40:33 +02:00
}
2016-04-01 21:41:45 +02:00
else {
assert . isTrue ( cache [ id ] === undefined ) ;
}
2015-07-09 23:40:33 +02:00
}
}
}
2016-04-01 21:41:45 +02:00
function checkResolvedModulesCache ( program : Program , fileName : string , expectedContent : Map < ResolvedModule > ) : void {
checkCache ( "resolved modules" , program , fileName , expectedContent , f = > f . resolvedModules , checkResolvedModule ) ;
}
function checkResolvedTypeDirectivesCache ( program : Program , fileName : string , expectedContent : Map < ResolvedTypeReferenceDirective > ) : void {
checkCache ( "resolved type directives" , program , fileName , expectedContent , f = > f . resolvedTypeReferenceDirectiveNames , checkResolvedTypeDirective ) ;
}
2015-07-09 23:40:33 +02:00
describe ( "Reuse program structure" , ( ) = > {
2016-05-24 19:17:16 +02:00
const target = ScriptTarget . Latest ;
const files = [
2015-09-10 19:46:39 +02:00
{ name : "a.ts" , text : SourceText.New (
`
/// <reference path='b.ts'/>
/// <reference path='non-existing-file.ts'/>
2016-04-01 21:41:45 +02:00
/// <reference types="typerefs" />
2016-05-24 19:17:16 +02:00
` , "", ` var x = 1 ` ) },
2015-07-09 23:40:33 +02:00
{ name : "b.ts" , text : SourceText.New ( ` /// <reference path='c.ts'/> ` , "" , ` var y = 2 ` ) } ,
{ name : "c.ts" , text : SourceText.New ( "" , "" , ` var z = 1; ` ) } ,
2016-04-01 21:41:45 +02:00
{ name : "types/typerefs/index.d.ts" , text : SourceText.New ( "" , "" , ` declare let z: number; ` ) } ,
2016-05-24 19:17:16 +02:00
] ;
2015-07-09 23:40:33 +02:00
it ( "successful if change does not affect imports" , ( ) = > {
2016-05-24 19:17:16 +02:00
const program_1 = newProgram ( files , [ "a.ts" ] , { target } ) ;
const program_2 = updateProgram ( program_1 , [ "a.ts" ] , { target } , files = > {
2015-07-09 23:40:33 +02:00
files [ 0 ] . text = files [ 0 ] . text . updateProgram ( "var x = 100" ) ;
} ) ;
assert . isTrue ( program_1 . structureIsReused ) ;
2016-05-24 19:17:16 +02:00
const program1Diagnostics = program_1 . getSemanticDiagnostics ( program_1 . getSourceFile ( "a.ts" ) ) ;
const program2Diagnostics = program_2 . getSemanticDiagnostics ( program_1 . getSourceFile ( "a.ts" ) ) ;
2015-09-10 19:46:39 +02:00
assert . equal ( program1Diagnostics . length , program2Diagnostics . length ) ;
2015-07-09 23:40:33 +02:00
} ) ;
2016-04-01 21:41:45 +02:00
it ( "successful if change does not affect type reference directives" , ( ) = > {
2016-05-24 19:17:16 +02:00
const program_1 = newProgram ( files , [ "a.ts" ] , { target } ) ;
const program_2 = updateProgram ( program_1 , [ "a.ts" ] , { target } , files = > {
2016-04-01 21:41:45 +02:00
files [ 0 ] . text = files [ 0 ] . text . updateProgram ( "var x = 100" ) ;
} ) ;
assert . isTrue ( program_1 . structureIsReused ) ;
2016-05-24 19:17:16 +02:00
const program1Diagnostics = program_1 . getSemanticDiagnostics ( program_1 . getSourceFile ( "a.ts" ) ) ;
const program2Diagnostics = program_2 . getSemanticDiagnostics ( program_1 . getSourceFile ( "a.ts" ) ) ;
2016-04-01 21:41:45 +02:00
assert . equal ( program1Diagnostics . length , program2Diagnostics . length ) ;
} ) ;
2015-07-09 23:40:33 +02:00
it ( "fails if change affects tripleslash references" , ( ) = > {
2016-05-24 19:17:16 +02:00
const program_1 = newProgram ( files , [ "a.ts" ] , { target } ) ;
2016-05-24 20:22:25 +02:00
updateProgram ( program_1 , [ "a.ts" ] , { target } , files = > {
2016-05-24 19:17:16 +02:00
const newReferences = ` /// <reference path='b.ts'/>
2015-07-09 23:40:33 +02:00
/// <reference path='c.ts'/>
` ;
files [ 0 ] . text = files [ 0 ] . text . updateReferences ( newReferences ) ;
} ) ;
assert . isTrue ( ! program_1 . structureIsReused ) ;
} ) ;
2016-06-13 23:43:19 +02:00
it ( "fails if change affects type references" , ( ) = > {
const program_1 = newProgram ( files , [ "a.ts" ] , { types : [ "a" ] } ) ;
updateProgram ( program_1 , [ "a.ts" ] , { types : [ "b" ] } , files = > {
} ) ;
assert . isTrue ( ! program_1 . structureIsReused ) ;
} ) ;
it ( "succeeds if change doesn't affect type references" , ( ) = > {
const program_1 = newProgram ( files , [ "a.ts" ] , { types : [ "a" ] } ) ;
updateProgram ( program_1 , [ "a.ts" ] , { types : [ "a" ] } , afiles = > {
} ) ;
assert . isTrue ( program_1 . structureIsReused ) ;
} ) ;
2015-07-09 23:40:33 +02:00
it ( "fails if change affects imports" , ( ) = > {
2016-05-24 19:17:16 +02:00
const program_1 = newProgram ( files , [ "a.ts" ] , { target } ) ;
2016-05-24 20:22:25 +02:00
updateProgram ( program_1 , [ "a.ts" ] , { target } , files = > {
2015-07-09 23:40:33 +02:00
files [ 2 ] . text = files [ 2 ] . text . updateImportsAndExports ( "import x from 'b'" ) ;
} ) ;
assert . isTrue ( ! program_1 . structureIsReused ) ;
} ) ;
2016-04-01 21:41:45 +02:00
it ( "fails if change affects type directives" , ( ) = > {
2016-05-24 19:17:16 +02:00
const program_1 = newProgram ( files , [ "a.ts" ] , { target } ) ;
2016-05-24 20:22:25 +02:00
updateProgram ( program_1 , [ "a.ts" ] , { target } , files = > {
2016-05-24 19:17:16 +02:00
const newReferences = `
2016-04-01 21:41:45 +02:00
/// <reference path='b.ts'/>
/// <reference path='non-existing-file.ts'/>
/// <reference types="typerefs1" />`;
files [ 0 ] . text = files [ 0 ] . text . updateReferences ( newReferences ) ;
} ) ;
assert . isTrue ( ! program_1 . structureIsReused ) ;
} ) ;
2015-07-09 23:40:33 +02:00
it ( "fails if module kind changes" , ( ) = > {
2016-05-24 19:17:16 +02:00
const program_1 = newProgram ( files , [ "a.ts" ] , { target , module : ModuleKind.CommonJS } ) ;
2016-05-24 20:22:25 +02:00
updateProgram ( program_1 , [ "a.ts" ] , { target , module : ModuleKind.AMD } , files = > void 0 ) ;
2015-07-09 23:40:33 +02:00
assert . isTrue ( ! program_1 . structureIsReused ) ;
} ) ;
2016-05-24 19:17:16 +02:00
2016-04-01 21:41:45 +02:00
it ( "fails if rootdir changes" , ( ) = > {
2016-05-24 19:17:16 +02:00
const program_1 = newProgram ( files , [ "a.ts" ] , { target , module : ModuleKind.CommonJS , rootDir : "/a/b" } ) ;
2016-05-24 20:22:25 +02:00
updateProgram ( program_1 , [ "a.ts" ] , { target , module : ModuleKind.CommonJS , rootDir : "/a/c" } , files = > void 0 ) ;
2016-04-01 21:41:45 +02:00
assert . isTrue ( ! program_1 . structureIsReused ) ;
} ) ;
it ( "fails if config path changes" , ( ) = > {
2016-05-24 19:17:16 +02:00
const program_1 = newProgram ( files , [ "a.ts" ] , { target , module : ModuleKind.CommonJS , configFilePath : "/a/b/tsconfig.json" } ) ;
2016-05-24 20:22:25 +02:00
updateProgram ( program_1 , [ "a.ts" ] , { target , module : ModuleKind.CommonJS , configFilePath : "/a/c/tsconfig.json" } , files = > void 0 ) ;
2016-04-01 21:41:45 +02:00
assert . isTrue ( ! program_1 . structureIsReused ) ;
} ) ;
2015-07-09 23:40:33 +02:00
it ( "resolution cache follows imports" , ( ) = > {
2016-05-24 19:17:16 +02:00
const files = [
2015-07-09 23:40:33 +02:00
{ name : "a.ts" , text : SourceText.New ( "" , "import {_} from 'b'" , "var x = 1" ) } ,
{ name : "b.ts" , text : SourceText.New ( "" , "" , "var y = 2" ) } ,
] ;
2016-05-24 19:17:16 +02:00
const options : CompilerOptions = { target } ;
2015-07-09 23:40:33 +02:00
2016-05-24 19:17:16 +02:00
const program_1 = newProgram ( files , [ "a.ts" ] , options ) ;
2015-09-10 20:36:31 +02:00
checkResolvedModulesCache ( program_1 , "a.ts" , { "b" : { resolvedFileName : "b.ts" } } ) ;
2015-07-09 23:40:33 +02:00
checkResolvedModulesCache ( program_1 , "b.ts" , undefined ) ;
2016-05-24 19:17:16 +02:00
const program_2 = updateProgram ( program_1 , [ "a.ts" ] , options , files = > {
2015-07-09 23:40:33 +02:00
files [ 0 ] . text = files [ 0 ] . text . updateProgram ( "var x = 2" ) ;
} ) ;
assert . isTrue ( program_1 . structureIsReused ) ;
// content of resolution cache should not change
2015-09-10 20:36:31 +02:00
checkResolvedModulesCache ( program_1 , "a.ts" , { "b" : { resolvedFileName : "b.ts" } } ) ;
2015-07-09 23:40:33 +02:00
checkResolvedModulesCache ( program_1 , "b.ts" , undefined ) ;
// imports has changed - program is not reused
2016-05-24 19:17:16 +02:00
const program_3 = updateProgram ( program_2 , [ "a.ts" ] , options , files = > {
2015-07-09 23:40:33 +02:00
files [ 0 ] . text = files [ 0 ] . text . updateImportsAndExports ( "" ) ;
} ) ;
assert . isTrue ( ! program_2 . structureIsReused ) ;
checkResolvedModulesCache ( program_3 , "a.ts" , undefined ) ;
2016-05-24 19:17:16 +02:00
const program_4 = updateProgram ( program_3 , [ "a.ts" ] , options , files = > {
const newImports = ` import x from 'b'
2015-07-09 23:40:33 +02:00
import y from 'c'
` ;
files [ 0 ] . text = files [ 0 ] . text . updateImportsAndExports ( newImports ) ;
} ) ;
assert . isTrue ( ! program_3 . structureIsReused ) ;
2015-09-10 20:36:31 +02:00
checkResolvedModulesCache ( program_4 , "a.ts" , { "b" : { resolvedFileName : "b.ts" } , "c" : undefined } ) ;
2015-07-09 23:40:33 +02:00
} ) ;
2016-04-01 21:41:45 +02:00
it ( "resolved type directives cache follows type directives" , ( ) = > {
2016-05-24 19:17:16 +02:00
const files = [
2016-04-06 01:33:11 +02:00
{ name : "/a.ts" , text : SourceText.New ( "/// <reference types='typedefs'/>" , "" , "var x = $" ) } ,
{ name : "/types/typedefs/index.d.ts" , text : SourceText.New ( "" , "" , "declare var $: number" ) } ,
2016-04-01 21:41:45 +02:00
] ;
2016-06-11 00:44:11 +02:00
const options : CompilerOptions = { target , typeRoots : [ "/types" ] } ;
2016-04-01 21:41:45 +02:00
2016-05-24 19:17:16 +02:00
const program_1 = newProgram ( files , [ "/a.ts" ] , options ) ;
2016-04-06 01:33:11 +02:00
checkResolvedTypeDirectivesCache ( program_1 , "/a.ts" , { "typedefs" : { resolvedFileName : "/types/typedefs/index.d.ts" , primary : true } } ) ;
checkResolvedTypeDirectivesCache ( program_1 , "/types/typedefs/index.d.ts" , undefined ) ;
2016-04-01 21:41:45 +02:00
2016-05-24 19:17:16 +02:00
const program_2 = updateProgram ( program_1 , [ "/a.ts" ] , options , files = > {
2016-04-01 21:41:45 +02:00
files [ 0 ] . text = files [ 0 ] . text . updateProgram ( "var x = 2" ) ;
} ) ;
assert . isTrue ( program_1 . structureIsReused ) ;
// content of resolution cache should not change
2016-04-06 01:33:11 +02:00
checkResolvedTypeDirectivesCache ( program_1 , "/a.ts" , { "typedefs" : { resolvedFileName : "/types/typedefs/index.d.ts" , primary : true } } ) ;
checkResolvedTypeDirectivesCache ( program_1 , "/types/typedefs/index.d.ts" , undefined ) ;
2016-04-01 21:41:45 +02:00
// type reference directives has changed - program is not reused
2016-05-24 19:17:16 +02:00
const program_3 = updateProgram ( program_2 , [ "/a.ts" ] , options , files = > {
2016-04-01 21:41:45 +02:00
files [ 0 ] . text = files [ 0 ] . text . updateReferences ( "" ) ;
} ) ;
assert . isTrue ( ! program_2 . structureIsReused ) ;
2016-04-06 01:33:11 +02:00
checkResolvedTypeDirectivesCache ( program_3 , "/a.ts" , undefined ) ;
2016-04-01 21:41:45 +02:00
2016-05-24 20:22:25 +02:00
updateProgram ( program_3 , [ "/a.ts" ] , options , files = > {
2016-05-24 19:17:16 +02:00
const newReferences = ` /// <reference types="typedefs"/>
2016-04-01 21:41:45 +02:00
/// <reference types="typedefs2"/>
` ;
files [ 0 ] . text = files [ 0 ] . text . updateReferences ( newReferences ) ;
} ) ;
assert . isTrue ( ! program_3 . structureIsReused ) ;
2016-04-06 01:33:11 +02:00
checkResolvedTypeDirectivesCache ( program_1 , "/a.ts" , { "typedefs" : { resolvedFileName : "/types/typedefs/index.d.ts" , primary : true } } ) ;
2016-04-01 21:41:45 +02:00
} ) ;
2016-04-11 05:42:22 +02:00
} ) ;
describe ( "host is optional" , ( ) = > {
it ( "should work if host is not provided" , ( ) = > {
createProgram ( [ ] , { } ) ;
2016-05-24 19:17:16 +02:00
} ) ;
2016-04-11 05:42:22 +02:00
} ) ;
2016-05-24 19:17:16 +02:00
}