File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change 1+ import { ValidateInput } from "code-skeleton/lib/generators/abstract" ;
12import { Generator } from "code-skeleton/lib/generators/abstract" ;
23import { readFile } from "node:fs/promises" ;
34import Mustache from "mustache" ;
@@ -25,6 +26,18 @@ class MustacheGenerator extends Generator<MustacheGeneratorOptions> {
2526 const rendered = Mustache . render ( source . toString ( ) , this . options . variables ) ;
2627 return rendered ;
2728 }
29+
30+ async validate ( options : ValidateInput ) : Promise < void > {
31+ const expected = await this . generate ( ) ;
32+
33+ if ( ! options . found . includes ( expected ) ) {
34+ this . report ( {
35+ expected,
36+ found : options . found ,
37+ message : `${ this . options . path } does not include the original template`
38+ } ) ;
39+ }
40+ }
2841}
2942
3043export function mustache ( options : MustacheGeneratorOptions ) {
You can’t perform that action at this time.
0 commit comments