Add comment support to `@gate` pragma (#21881)

So you can more easily comment on why a test is gated.
This commit is contained in:
Andrew Clark 2021-07-14 13:36:24 -04:00 committed by GitHub
parent 81346764bb
commit f0efb7b70f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 0 deletions

View File

@ -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', () => {

View File

@ -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) {