-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dfbd305
commit 720cfba
Showing
5 changed files
with
2,452 additions
and
1,182 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
prefix ex: <http://example.org/> | ||
SELECT ?a ?b WHERE { | ||
?a ex:example ?b. | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { existsSync, readFileSync } from 'fs'; | ||
import { execSync } from 'child_process'; | ||
|
||
describe('Build test: generate.js', () => { | ||
beforeAll(() => { | ||
}); | ||
|
||
describe('generate.js', () => { | ||
describe('command line arguments', () => { | ||
beforeEach(() => { | ||
execSync('rm -rf testBuildOutput'); | ||
}); | ||
|
||
afterEach(() => { | ||
execSync('rm -rf testBuildOutput'); | ||
}); | ||
|
||
it('should correctly handle option -d', async() => { | ||
execSync('node bin/generate.js -d testBuildOutput', { encoding: 'utf-8' }); // the default is 'buffer' | ||
expect(existsSync('testBuildOutput')).toEqual(true); | ||
}); | ||
|
||
it('should correctly handle option -q', async() => { | ||
execSync('node bin/generate.js -d testBuildOutput -q tests/test-queries', { encoding: 'utf-8' }); // the default is 'buffer' | ||
let buildQueries = JSON.parse(readFileSync("./build/queries.json")).queries; | ||
expect(buildQueries).toEqual( | ||
[ | ||
{ | ||
"name":"1", | ||
"datasources":[], | ||
"queryFormat":"sparql", | ||
"query":"prefix ex: <http://example.org/>\nSELECT ?a ?b WHERE {\n ?a ex:example ?b.\n}" | ||
} | ||
]); | ||
}); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
prefix ex: <http://example.org/> | ||
SELECT ?a ?b WHERE { | ||
?a ex:example ?b. | ||
} |
Oops, something went wrong.