WIP ignore GitHub Action related environment variables, and fix "Use the repository URL as is if none of the given git credentials are valid" which should never have passed before but well here we are
This commit is contained in:
parent
0ae2f632ff
commit
9e83fa020d
@ -35,10 +35,21 @@ const env = {
|
|||||||
GH_TOKEN: gitbox.gitCredential,
|
GH_TOKEN: gitbox.gitCredential,
|
||||||
GITHUB_URL: mockServer.url,
|
GITHUB_URL: mockServer.url,
|
||||||
GITHUB_EVENT_NAME: 'push',
|
GITHUB_EVENT_NAME: 'push',
|
||||||
GITHUB_REF: 'master',
|
GITHUB_REF: 'master'
|
||||||
GITHUB_EVENT_PATH: '',
|
|
||||||
GITHUB_ACTION: ''
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// ignore certain environment variables that are set on CI and that would
|
||||||
|
// interfere with our test setup
|
||||||
|
const {
|
||||||
|
GITHUB_URL,
|
||||||
|
GITHUB_EVENT_NAME,
|
||||||
|
GITHUB_REF,
|
||||||
|
GITHUB_EVENT_PATH,
|
||||||
|
GITHUB_ACTION,
|
||||||
|
GITHUB_TOKEN,
|
||||||
|
...processEnv
|
||||||
|
} = process.env
|
||||||
|
|
||||||
// Environment variables used only for the local npm command used to do verification
|
// Environment variables used only for the local npm command used to do verification
|
||||||
const testEnv = {
|
const testEnv = {
|
||||||
...process.env,
|
...process.env,
|
||||||
@ -680,7 +691,7 @@ test('Use the valid git credentials when multiple are provided', async (t) => {
|
|||||||
|
|
||||||
test('Use the repository URL as is if none of the given git credentials are valid', async (t) => {
|
test('Use the repository URL as is if none of the given git credentials are valid', async (t) => {
|
||||||
const {cwd} = await gitbox.createRepo('test-invalid-auth');
|
const {cwd} = await gitbox.createRepo('test-invalid-auth');
|
||||||
const dummyUrl = 'http://toto@localhost:2080/git/test-auth.git';
|
const dummyUrl = 'http://toto@localhost:2080/git/test-invalid-auth.git';
|
||||||
|
|
||||||
t.is(
|
t.is(
|
||||||
await getAuthUrl({
|
await getAuthUrl({
|
||||||
|
Loading…
x
Reference in New Issue
Block a user