MCPcopy Create free account
hub / github.com/decaporg/decap-cms / setupGitLab

Function setupGitLab

cypress/plugins/gitlab.js:146–179  ·  view source on GitHub ↗
(options)

Source from the content-addressed store, hash-verified

144}
145
146async function setupGitLab(options) {
147 if (process.env.RECORD_FIXTURES) {
148 console.log('Running tests in "record" mode - live data with be used!');
149 const [user, repoData] = await Promise.all([getUser(), prepareTestGitLabRepo()]);
150
151 await updateConfig(config => {
152 merge(config, options, {
153 backend: {
154 repo: `${repoData.owner}/${repoData.repo}`,
155 },
156 });
157 });
158
159 return { ...repoData, user, mockResponses: false };
160 } else {
161 console.log('Running tests in "playback" mode - local data with be used');
162
163 await updateConfig(config => {
164 merge(config, options, {
165 backend: {
166 repo: `${GITLAB_REPO_OWNER_SANITIZED_VALUE}/${GITLAB_REPO_NAME_SANITIZED_VALUE}`,
167 },
168 });
169 });
170
171 return {
172 owner: GITLAB_REPO_OWNER_SANITIZED_VALUE,
173 repo: GITLAB_REPO_NAME_SANITIZED_VALUE,
174 user: { ...FAKE_OWNER_USER, token: GITLAB_REPO_TOKEN_SANITIZED_VALUE, backendName: 'gitlab' },
175
176 mockResponses: true,
177 };
178 }
179}
180
181async function teardownGitLab(taskData) {
182 if (process.env.RECORD_FIXTURES) {

Callers 1

setupBackendFunction · 0.85

Calls 4

prepareTestGitLabRepoFunction · 0.85
mergeFunction · 0.85
getUserFunction · 0.70
updateConfigFunction · 0.70

Tested by

no test coverage detected