2017-12-26 11:12:08 +08:00
|
|
|
it("should generate a events.json file", () => {
|
|
|
|
var fs = require("fs"),
|
|
|
|
path = require("path"),
|
|
|
|
os = require("os");
|
2018-02-25 08:20:45 +08:00
|
|
|
expect(fs.existsSync(path.join(__dirname, "events.json"))).toBe(true);
|
2017-12-26 11:12:08 +08:00
|
|
|
});
|
|
|
|
|
|
|
|
it("should have proper setup record inside of the json stream", () => {
|
|
|
|
var fs = require("fs"),
|
|
|
|
path = require("path"),
|
|
|
|
os = require("os");
|
|
|
|
|
|
|
|
// convert json stream to valid
|
2018-02-25 08:20:45 +08:00
|
|
|
var source = JSON.parse(fs.readFileSync(path.join(__dirname, "events.json"), "utf-8").toString() + "{}]");
|
2018-01-27 06:59:38 +08:00
|
|
|
expect(source[0].id).toEqual(1);
|
2018-02-25 08:20:45 +08:00
|
|
|
});
|