elm-pages-v3-beta/tests/generated-files.test.js

19 lines
729 B
JavaScript
Raw Normal View History

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");
2020-05-17 22:21:55 +03:00
test('generate UI file', async () => {
process.chdir(__dirname);
2020-05-17 22:21:55 +03:00
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);
2020-08-23 17:35:03 +03:00
const generated = await generateTemplateModuleConnector();
expect(generated).toMatchSnapshot();
});