import * as assert from "assert" ; import * as fse from "fs-extra" ; import { Context } from "mocha" ; import { parseTemplate } from "./support/parseTemplate" ; import { resolveInTestFolder } from "./support/resolveInTestFolder" ; suite ( "Performance tests" , ( ) => { suite ( "warnings and errors performance" , ( ) => { test ( "Lots of variables" , async function ( this ) : Promise < Promise < void > > { this . timeout ( 5000 ) ; const sourcePath = resolveInTestFolder ( 'templates/performance/50params5000vars5refs.json' ) ; const templateContents = ( await fse . readFile ( sourcePath ) ) . toString ( ) ; const dt = parseTemplate ( templateContents ) ; const warnings = dt . getWarnings ( ) ; assert . strictEqual ( warnings . length , 5000 ) ; assert . strictEqual ( warnings [ 0 ] . message , "The variable 'var1' is never used." ) ; } ) ; } ) ; } ) ;