Skip to content

Commit

Permalink
Add comment support to @gate pragma
Browse files Browse the repository at this point in the history
So you can more easily comment on why a test is gated.
  • Loading branch information
acdlite committed Jul 14, 2021
1 parent 8134676 commit 1d966ba
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions scripts/babel/__tests__/transform-test-gate-pragma-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,11 @@ describe('transform-test-gate-pragma', () => {
test('single quoted strings', () => {
expect(shouldPass).toBe(true);
});

// @gate flagThatIsOn // This is a comment
test('line comment', () => {
expect(shouldPass).toBe(true);
});
});

describe('transform test-gate-pragma: actual runtime', () => {
Expand Down
4 changes: 4 additions & 0 deletions scripts/babel/transform-test-gate-pragma.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ function transform(babel) {
tokens.push({type: next2});
i += 2;
continue;
case '//':
// This is the beginning of a line comment. The rest of the line
// is ignored.
return tokens;
}

switch (char) {
Expand Down

0 comments on commit 1d966ba

Please sign in to comment.