|
1 | 1 | import { describe, expect, it } from 'vitest'; |
2 | | -import { ajv } from '../utils/ajv'; |
3 | | -import { AjvValidationError } from './errors'; |
| 2 | +import { ajv } from '../utils/ajv.js'; |
| 3 | +import { AjvValidationError } from './errors.js'; |
4 | 4 | import { ResourceSchema } from 'codify-schemas'; |
5 | | -import { SourceMapCache } from '../parser/source-maps'; |
6 | | -import { JsonParser } from '../parser/json/json-parser'; |
7 | | -import { FileType } from '../parser/entities'; |
| 5 | +import { SourceMapCache } from '../parser/source-maps.js'; |
| 6 | +import { JsonParser } from '../parser/json/json-parser.js'; |
| 7 | +import { FileType } from '../parser/entities.js'; |
8 | 8 | import stripAnsi from 'strip-ansi'; |
9 | 9 |
|
10 | 10 | describe('AjvValidationError tests', () => { |
@@ -62,15 +62,17 @@ describe('AjvValidationError tests', () => { |
62 | 62 |
|
63 | 63 | console.log(error.formattedMessage()) |
64 | 64 | expect(stripAnsi(error.formattedMessage())).to.eq( |
65 | | -`Validation error: resource is not valid |
| 65 | +`Validation error: resource is not valid. |
66 | 66 |
|
67 | | -"/dependsOn" must be array |
68 | | - |
69 | | - 7| { |
70 | | - 8| "type": "resourceType", |
71 | | - 9| "name": "something", |
72 | | -> 10| "dependsOn": "supposed to be an array" |
73 | | - 11| } |
74 | | - 12| ]`) |
| 67 | +1. Validation error: "dependsOn" must be array |
| 68 | + File: /test/path/to/test.json |
| 69 | + 7 | { |
| 70 | + 8 | "type": "resourceType", |
| 71 | + 9 | "name": "something", |
| 72 | + > 10 | "dependsOn": "supposed to be an array" |
| 73 | + 11 | } |
| 74 | + 12 | ] |
| 75 | + |
| 76 | +`) |
75 | 77 | }) |
76 | 78 | }) |
0 commit comments