Created
December 23, 2020 15:56
-
-
Save snewcomer/b991bbb2c71a4d315ad8368e5117e526 to your computer and use it in GitHub Desktop.
Ember FastBoot runtime test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 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