Skip to content

Instantly share code, notes, and snippets.

@snewcomer
Created December 23, 2020 15:56
Show Gist options
  • Save snewcomer/b991bbb2c71a4d315ad8368e5117e526 to your computer and use it in GitHub Desktop.
Save snewcomer/b991bbb2c71a4d315ad8368e5117e526 to your computer and use it in GitHub Desktop.
Ember FastBoot runtime test
/* eslint-env node */
/**
* This can be run as an npm script a part of your CI testing
*
* This is a "smoke test" to make sure that the application, when run
* within FastBoot, isn't calling APIs that aren't supported by the
* Node.js environment. (e.g. window.alert)
*/
// process.env.MY_ENV_FLAGS = '';
const FastBoot = require('fastboot');
const path = require('path');
(async function () {
const app = new FastBoot({
distPath: path.join(__dirname, '..', 'dist'),
resilient: true,
});
const result = await app.visit('/', {
// May not need this
request: {
headers: {
host: 'http://localhost:4200',
},
},
});
if (result.error) {
process.exit(1);
} else {
process.exit(0);
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment