File tree Expand file tree Collapse file tree 5 files changed +48
-3
lines changed
Expand file tree Collapse file tree 5 files changed +48
-3
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,6 @@ insert_final_newline = true
1616trim_trailing_whitespace = false
1717indent_size = 2
1818
19- [{ package.json,bower.json} ]
19+ [package.json ]
2020indent_style = space
2121indent_size = 2
Original file line number Diff line number Diff line change 11{
22 "printWidth": 120,
3- "tabWidth": 4,
43 "singleQuote": false,
54 "bracketSpacing": true,
65 "trailingComma": "none"
Original file line number Diff line number Diff line change 2929 "test:6:ci" : " DISABLE_LOG=true mocha -R json 'src/tests/spec/draft06.spec.ts' > test-result-spec6.json; exit 0" ,
3030 "test:7" : " mocha 'src/tests/spec/draft07.spec.ts'" ,
3131 "test:7:ci" : " DISABLE_LOG=true mocha -R json 'src/tests/spec/draft07.spec.ts' > test-result-spec7.json; exit 0" ,
32- "test:inspect" : " yarn test:2019 --inspect-brk" ,
32+ "test:inspect" : " yarn test:unit --inspect-brk" ,
3333 "test:spec" : " mocha 'src/tests/spec/*.spec.ts'" ,
3434 "test:unit" : " mocha 'src/**/*.test.ts'" ,
3535 "test:unit:ci" : " DISABLE_LOG=true mocha -R json 'src/**/*.test.ts' -R json > test-result-unit.json; exit 0"
Original file line number Diff line number Diff line change 1+ import { strict as assert } from "assert" ;
2+ import { compileSchema } from "../../compileSchema" ;
3+
4+ // @todo investigate different requirements on joining url and id
5+ // here json-schemer://schema + stock-assembly is joined to json-schemer://stock-assembly
6+ // in joinId: const trailingFragments = /\/\/*$/; will fix this issue but fail spec tests
7+ describe . skip ( "issue#82" , ( ) => {
8+ it ( "should return validation errors for number" , ( ) => {
9+ const schema = compileSchema ( {
10+ $schema : "https://json-schema.org/draft/2020-12/schema" ,
11+ type : "object" ,
12+ required : [ "stock-assembly" ] ,
13+ properties : {
14+ "stock-assembly" : {
15+ $ref : "stock-assembly"
16+ }
17+ } ,
18+ $id : "json-schemer://schema" , // this works only if a trailing slash
19+ $defs : {
20+ "json-schemer://schema/stock-assembly" : {
21+ $schema : "http://json-schema.org/draft-07/schema#" ,
22+ type : "object" ,
23+ properties : {
24+ $filter : {
25+ type : "string" ,
26+ title : "Фильтр"
27+ }
28+ } ,
29+ $id : "json-schemer://schema/stock-assembly"
30+ }
31+ }
32+ } ) ;
33+
34+ const { valid, errors } = schema . validate ( {
35+ "stock-assembly" : 1
36+ } ) ;
37+
38+ assert . equal ( valid , false ) ;
39+ } ) ;
40+ } ) ;
Original file line number Diff line number Diff line change @@ -50,6 +50,12 @@ describe("joinId", () => {
5050 assert . equal ( url , "https://localhost.com/root#bar" ) ;
5151 } ) ;
5252
53+ it . skip ( "should append id without fragment to url" , ( ) => {
54+ const url = joinId ( "https://localhost.com/root" , "bar" ) ;
55+
56+ assert . equal ( url , "https://localhost.com/root/bar" ) ;
57+ } ) ;
58+
5359 it ( "should append id to url/" , ( ) => {
5460 const url = joinId ( "https://localhost.com/root/" , "#bar" ) ;
5561
You can’t perform that action at this time.
0 commit comments