File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ const { spawnSync } = require("child_process");
66const repoRoot = path . resolve ( __dirname , ".." ) ;
77const tempDir = fs . mkdtempSync ( path . join ( os . tmpdir ( ) , "ejvm-types-" ) ) ;
88const tarballDir = path . join ( tempDir , "tarballs" ) ;
9- const sourcePath = path . join ( tempDir , "validation-error .ts" ) ;
9+ const sourcePath = path . join ( tempDir , "consumer .ts" ) ;
1010
1111function run ( command , args , options = { } ) {
1212 const result = spawnSync ( command , args , {
2828 fs . writeFileSync (
2929 sourcePath ,
3030 [
31- 'import { ValidationError } from "express-json-validator-middleware";' ,
31+ 'import { ValidationError, Validator } from "express-json-validator-middleware";' ,
32+ "" ,
33+ "const defaultValidator = new Validator();" ,
34+ "" ,
35+ "defaultValidator.validate({" ,
36+ "\tbody: {" ,
37+ '\t\ttype: "object"' ,
38+ "\t}" ,
39+ "});" ,
40+ "" ,
41+ "const configuredValidator = new Validator({" ,
42+ "\tallErrors: true" ,
43+ "});" ,
44+ "" ,
45+ "configuredValidator.validate({" ,
46+ "\tbody: {" ,
47+ '\t\ttype: "object"' ,
48+ "\t}" ,
49+ "});" ,
3250 "" ,
3351 "const validationError = new ValidationError({" ,
3452 "\tparams: [" ,
Load diff This file was deleted.
You can’t perform that action at this time.
0 commit comments