Skip to content
This repository has been archived by the owner on Mar 14, 2022. It is now read-only.

Commit

Permalink
check just for the substring
Browse files Browse the repository at this point in the history
  • Loading branch information
chee committed Aug 25, 2021
1 parent 99becb5 commit e7fe404
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions test/integration/demo/demo.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,28 +92,26 @@ describe('obt demo', function () {
describe('demo with bad json', function () {
let testDirectory;
let fixturesDirectory;
let brokenDemoConfig;

before(async function () {
// copy fixture (example component with multiple demos)
// to a temporary test directory
testDirectory = await tmpdir('obt-demo-task-');
fixturesDirectory = path.resolve(__dirname, 'fixtures/multiple-demos');
brokenDemoConfig = {
"title": "Data broken",
"name": "data-broken",
"template": "demos/src/demo-1.mustache",
"description": "This demo has broken data",
"data": "demos/src/data-broken.json"
};
fs.copySync(fixturesDirectory, testDirectory);
process.chdir(testDirectory);
// update the demo configuration in origami.json so multiple demos
// have the same name
const testManifestPath = path.resolve(testDirectory, 'origami.json');
const testManifestContent = fs.readFileSync(testManifestPath);
const testManifest = JSON.parse(testManifestContent);
testManifest.demos.push(brokenDemoConfig);
testManifest.demos.push({
"title": "Data broken",
"name": "data-broken",
"template": "demos/src/demo-1.mustache",
"description": "This demo has broken data",
"data": "demos/src/data-broken.json"
});
fs.writeFileSync(testManifestPath, JSON.stringify(testManifest));
});

Expand All @@ -134,7 +132,7 @@ describe('obt demo', function () {
try {
proclaim.include(
e.message,
`${testDirectory}/demos/src/${brokenDemoConfig.data} is not valid JSON.`
`is not valid JSON.`
);
} catch(e) {
done(e);
Expand Down

0 comments on commit e7fe404

Please sign in to comment.