Skip to content
Snippets Groups Projects
Commit ba218180 authored by Lars Trieloff's avatar Lars Trieloff
Browse files

fix tests

parent 965907f8
Branches
Tags
No related merge requests found
...@@ -80,6 +80,7 @@ A simple string. ...@@ -80,6 +80,7 @@ A simple string.
##### foo Example ##### foo Example
```json ```json
...@@ -119,6 +120,7 @@ A simple string. ...@@ -119,6 +120,7 @@ A simple string.
##### bar Example ##### bar Example
```json ```json
...@@ -251,6 +253,7 @@ All items must be of the type: ...@@ -251,6 +253,7 @@ All items must be of the type:
## listlist ## listlist
This is an array of arrays This is an array of arrays
......
...@@ -31,8 +31,8 @@ This is an example schema that uses types defined in other schemas. ...@@ -31,8 +31,8 @@ This is an example schema that uses types defined in other schemas.
| [reflist](#reflist) | Simple | Optional | No | Complex References (this schema) | | [reflist](#reflist) | Simple | Optional | No | Complex References (this schema) |
| [refnamed](#refnamed) | Simple | Optional | No | Complex References (this schema) | | [refnamed](#refnamed) | Simple | Optional | No | Complex References (this schema) |
| [xor](#xor) | complex | Optional | No | Complex References (this schema) | | [xor](#xor) | complex | Optional | No | Complex References (this schema) |
| `int.*` | `integer` | | Complex References (this schema) | | `int.*` | `integer` | Pattern No | Complex References (this schema) |
| `str.*` | `string` | | Complex References (this schema) | | `str.*` | `string` | Pattern No | Complex References (this schema) |
| `*` | any | Additional | Yes | this schema *allows* additional properties | | `*` | any | Additional | Yes | this schema *allows* additional properties |
## and ## and
......
...@@ -30,6 +30,7 @@ This schema test type arrays and nullable types ...@@ -30,6 +30,7 @@ This schema test type arrays and nullable types
This is just nothing This is just nothing
`null` `null`
* is optional * is optional
* type: `null` * type: `null`
* defined in this schema * defined in this schema
...@@ -48,6 +49,7 @@ This property can only have the value `null`. ...@@ -48,6 +49,7 @@ This property can only have the value `null`.
Nullable string Nullable string
`string-or-null` `string-or-null`
* is optional * is optional
* type: `string` * type: `string`
* defined in this schema * defined in this schema
...@@ -62,11 +64,13 @@ Nullable string ...@@ -62,11 +64,13 @@ Nullable string
## string-or-number ## string-or-number
Types can be many things Types can be many things
`string-or-number` `string-or-number`
* is optional * is optional
* type: multiple * type: multiple
* defined in this schema * defined in this schema
...@@ -87,6 +91,7 @@ Either one of: ...@@ -87,6 +91,7 @@ Either one of:
Types can be many things, even nothing at all. Types can be many things, even nothing at all.
`string-or-number-null` `string-or-number-null`
* is optional * is optional
* type: multiple * type: multiple
* defined in this schema * defined in this schema
...@@ -102,3 +107,13 @@ Either one of: ...@@ -102,3 +107,13 @@ Either one of:
**All** of the following *requirements* need to be fulfilled.
#### Requirement 1
* []()`#/definitions/id`
const { spawn } = require('child_process'); const { spawn } = require('child_process');
const { readFile, readdirSync, statSync } = require('fs'); const path = require('path');
const { readFileSync, readdirSync, statSync } = require('fs');
beforeEach(function() { beforeEach(function() {
jasmine.addMatchers( jasmine.addMatchers(
require('jasmine-diff')(jasmine, { require('jasmine-diff')(jasmine, {
colors: true, colors: true,
inline: true inline: false
}) })
); );
}); });
...@@ -64,14 +65,10 @@ describe('Compare results', () => { ...@@ -64,14 +65,10 @@ describe('Compare results', () => {
if (statSync('./spec/examples/' + file).isFile()) { if (statSync('./spec/examples/' + file).isFile()) {
it('Comparing ' + file, indone => { it('Comparing ' + file, indone => {
console.log('file ' + file); console.log('file ' + file);
readFile('./spec/examples/' + file, (err, expectedbuf) => { const expectedstr = readFileSync(path.resolve('./spec/examples/', file)).toString();
expect(err).toBeNull(); const actualstr = readFileSync(path.resolve('./examples/docs/', file)).toString();
readFile('./examples/docs/' + file, (err, actualbuf) => { expect(actualstr).toEqual(expectedstr);
expect(err).toBeNull(); indone();
expect(actualbuf.toString()).toEqual(expectedbuf.toString());
indone();
});
});
}); });
} }
}); });
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment