elm-pages-v3-beta/tests/generated-files.test.js
2020-08-23 07:35:03 -07:00

19 lines
729 B
JavaScript

const { elmPagesCliFile, elmPagesUiFile } = require("../generator/src/elm-file-constants.js");
const { generateTemplateModuleConnector } = require("../generator/src/generate-template-module-connector.js");
const generateRecords = require("../generator/src/generate-records.js");
test('generate UI file', async () => {
process.chdir(__dirname);
const staticRoutes = await generateRecords();
global.builtAt = new Date("Sun, 17 May 2020 16:53:22 GMT");
expect(elmPagesUiFile(staticRoutes, [])).toMatchSnapshot();
});
test('generate template module connector', async () => {
process.chdir(__dirname);
const generated = await generateTemplateModuleConnector();
expect(generated).toMatchSnapshot();
});