Skip to content

Commit

Permalink
We actually only need to skip VLSpec validation but not Vg.
Browse files Browse the repository at this point in the history
Also improve the suffix check.  (This should be faster than the old condition and regexp)

cc: @arvind
  • Loading branch information
kanitw committed Sep 8, 2017
1 parent f0c7219 commit 2a7978f
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions examples/examples.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,21 +48,23 @@ describe('Examples', function() {
const examples = fs.readdirSync('examples/specs');

examples.forEach(function(example: string) {
if (
path.extname(example) !== '.json' ||
// Do not validate overlay example until we have redesigned it
example.indexOf('overlay') >= 0 ||
// Also ignore box-plot examples until we support selections
example.indexOf('box-plot') >= 0 ||
// Also ignore all examples with "_future" suffix
example.lastIndexOf('_future.vl.json') === example.length - suffixLength
) {
if (path.extname(example) !== '.json') {
return;
}
const jsonSpec = JSON.parse(fs.readFileSync('examples/specs/' + example));

describe(example, function() {
it('should be valid vega-lite with proper $schema', function() {
if (
// Do not validate overlay example until we have redesigned it
example.indexOf('overlay') >= 0 ||
// Also ignore box-plot examples until we support selections
example.indexOf('box-plot') >= 0 ||
// Also ignore all examples with "_future" suffix
example.lastIndexOf('_future.vl.json', example.length - suffixLength) >= 0
) {
return;
}
validateVL(jsonSpec);
});

Expand Down

0 comments on commit 2a7978f

Please sign in to comment.