Require an access token in tests

This commit is contained in:
Kev 2022-02-07 15:12:45 +00:00 committed by Marcel van Remmerden
parent 0c4f8cc924
commit 8de4ac857d
1 changed files with 21 additions and 0 deletions

View File

@ -1,3 +1,24 @@
if (!process.env.ACCESS_TOKEN) {
console.error();
console.error(' ✋ \x1b[33;1mAccess token required\x1b[0m');
console.error();
console.error(' A GitLab.com personal access token as an \x1b[92mACCESS_TOKEN\x1b[0m');
console.error(' environment variable with the \x1b[92mread_api\x1b[0m scope is required');
console.error(' to run the GitDock tests.');
console.error();
if (process.env.CI) {
console.error(' In project forks, an \x1b[92mACCESS_TOKEN\x1b[0m CI/CD variable must be');
console.error(' set for tests to be able to run for your merge requests.');
console.error();
}
console.error(' See \x1b[92mCONTRIBUTING.md\x1b[0m for details and help.');
console.error();
process.exit(1);
}
module.exports = {
extension: ['.spec.js'],
};