import { Inject , Injectable } from "./deps.ts" ; import { assert , assertEquals , test } from "./test_deps.ts" ; import { ModuleRef , MvModule , platformMomentum } from "./mod.ts" ; @ Injectable ( ) class Service { @ Inject ( "MESSAGE" ) message ? : string ; } @ MvModule ( { providers : [ { provide : "MESSAGE" , useValue : "Hello, Momentum!" } , ] } ) class AppModule { } test ( "Platform.bootstrapModule() - bootstraps module" , async ( ) => { const platform = platformMomentum ( ) ; const bootstrapped = await platform . bootstrapModule ( AppModule ) ; assert ( bootstrapped . module instanceof ModuleRef ) ; } ) ; test ( "Platform.resolve() - resolves module dependency" , async ( ) => { const platform = await platformMomentum ( ) . bootstrapModule ( AppModule ) ; const service = await platform . resolve < Service > ( Service ) ; assertEquals ( service . message , "Hello, Momentum!" ) ; } ) ;