Skip to content

Commit

Permalink
chore(danger): check for created files as well
Browse files Browse the repository at this point in the history
  • Loading branch information
JackuB committed Oct 1, 2020
1 parent 59df69b commit 5f46c9b
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions dangerfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ if (danger.github && danger.github.pr) {
}

// Forgotten tests check
const modifiedTest = danger.git.modified_files.some((f) =>
f.startsWith('test/'),
);
const modifiedSrc = danger.git.modified_files.some((f) =>
f.startsWith('src/'),
);
const modifiedTest =
danger.git.modified_files.some((f) => f.startsWith('test/')) ||
danger.git.created_files.some((f) => f.startsWith('test/'));
const modifiedSrc =
danger.git.modified_files.some((f) => f.startsWith('src/')) ||
danger.git.created_files.some((f) => f.startsWith('src/'));

if (modifiedSrc && !modifiedTest) {
// TODO: let's be careful about wording here. Maybe including Contributing guidelines and project goals document here
Expand All @@ -54,6 +54,7 @@ if (danger.github && danger.github.pr) {
// Smoke test modification check
const modifiedSmokeTest =
danger.git.modified_files.some((f) => f.startsWith('test/smoke/')) ||
danger.git.created_files.some((f) => f.startsWith('test/smoke/')) ||
danger.git.modified_files.includes(SMOKE_TEST_WORKFLOW_FILE_PATH);

const isOnSmokeTestBranch = danger.github.pr.head.ref === SMOKE_TEST_BRANCH;
Expand Down

0 comments on commit 5f46c9b

Please sign in to comment.