MCPcopy Create free account
hub / github.com/angular/dev-infra / createIsolatedValidationConfig

Function createIsolatedValidationConfig

ng-dev/pr/common/test/common.spec.ts:258–275  ·  view source on GitHub ↗
(
  overrides: Partial<PullRequestValidationConfig>,
)

Source from the content-addressed store, hash-verified

256 });
257 });
258
259 describe('assert-enforce-tested', () => {
260 it('should require a TGP when label is present', async () => {
261 const config = createIsolatedValidationConfig({assertEnforceTested: true});
262 let pr = createTestPullRequest();
263 const commentHelper = PullRequestComments.create(git, pr.number);
264 spyOn(PullRequestComments, 'create').and.returnValue(commentHelper);
265 spyOn(commentHelper, 'loadPullRequestComments').and.returnValue(Promise.resolve([]));
266 pr.labels.nodes.push({name: requiresLabels['REQUIRES_TGP'].name});
267 const results = await assertValidPullRequest(pr, config, ngDevConfig, null, prTarget, git);
268 expect(results.length).toBe(1);
269 expect(results[0].message).toBe(
270 'Pull Request requires a TGP and does not have one. Either run a TGP or specify the PR is fully tested by adding a comment with "TESTED=[reason]".',
271 );
272 });
273
274 it('should pass when label is present and TESTED comment exists', async () => {
275 const config = createIsolatedValidationConfig({assertEnforceTested: true});
276 let pr = createTestPullRequest();
277 const comments = [
278 {

Callers 1

common.spec.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected