-
Notifications
You must be signed in to change notification settings - Fork 5
Modernization #17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Modernization #17
Changes from 4 commits
0abcfda
f177bf5
ab14d7e
fe608ad
f7f5757
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
node_modules | ||
node_modules | ||
package-lock.json | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,52 @@ | ||
var htmlbook = require('../htmlbook'); | ||
var fs = require('fs'); | ||
var exec = require('child_process').exec; | ||
const tmp = require('tmp'); | ||
|
||
jasmine.getEnv().defaultTimeoutInterval = 100000; | ||
tmp.setGracefulCleanup(); | ||
|
||
jasmine.DEFAULT_TIMEOUT_INTERVAL = 100000; | ||
|
||
var convert_and_validate = function (file_name, callback) { | ||
fs.readFile(file_name, "utf-8", function (err, source) { | ||
tmp.file((err, path, _) => { | ||
if (err) throw err; | ||
fs.readFile(file_name, "utf-8", function (err, source) { | ||
if (err) throw err; | ||
|
||
html = htmlbook(source).parse({"complete_html": true, "title": "Test"}) | ||
html = htmlbook(source).parse({ "complete_html": true, "title": "Test" }) | ||
|
||
fs.writeFile("spec/documents/validation.html", html, function () { | ||
exec("xmllint --noout --schema ../HTMLBook/schema/htmlbook.xsd spec/documents/validation.html", function (err, stdout, stderr) { | ||
expect(stderr).toEqual("spec/documents/validation.html validates\n"); | ||
fs.unlink("spec/documents/validation.html"); | ||
callback(); | ||
}); | ||
}) | ||
}); | ||
fs.writeFile(`${path}.html`, html, function () { | ||
exec(`xmllint --noout --schema ../HTMLBook/schema/htmlbook.xsd ${path}.html`, function (err, _stdout, stderr) { | ||
if (err) throw err; | ||
expect(stderr).toEqual(`${path}.html validates\n`); | ||
callback(); | ||
}); | ||
}) | ||
}); | ||
|
||
} | ||
|
||
) | ||
} | ||
|
||
describe("htmlbook validations", function () { | ||
it("BBEPart2", function (done) { | ||
xit("BBEPart2", function (done) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need to keep these tests if they're no longer needed? Or figure out how to fix at some point? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These have disappeared from the repo; I'd like to try and find them eventually, but maybe it's not worth it? I could go either way; this is not a heavily used part of Atlas (and in fact we recommend against it, strongly). |
||
convert_and_validate("spec/samples/BBEPart2.md", done) | ||
}) | ||
|
||
it("streams", function (done) { | ||
xit("streams", function (done) { | ||
convert_and_validate("spec/samples/streams.md", done) | ||
}) | ||
|
||
it("artofnode", function (done) { | ||
xit("artofnode", function (done) { | ||
convert_and_validate("spec/samples/artofnode.md", done) | ||
}) | ||
|
||
it("dataviz tech", function (done) { | ||
xit("dataviz tech", function (done) { | ||
convert_and_validate("spec/samples/dataviz_tech.md", done) | ||
}) | ||
|
||
it("dataviz data", function (done) { | ||
xit("dataviz data", function (done) { | ||
convert_and_validate("spec/samples/dataviz_data.md", done) | ||
}) | ||
|
||
|
@@ -60,7 +70,7 @@ describe("htmlbook validations", function () { | |
convert_and_validate("spec/documents/math.md", done); | ||
}); | ||
|
||
it ("should convert opengovernment spec", function (done) { | ||
it("should convert opengovernment spec", function (done) { | ||
convert_and_validate("../HTMLBook/samples/markdown/open_government_sample.md", done); | ||
}); | ||
}); | ||
}); |
Uh oh!
There was an error while loading. Please reload this page.