Skip to content

Commit

Permalink
"/" support in @providesModule (jestjs#2040)
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronabramov authored and cpojer committed Nov 2, 2016
1 parent 8e3be2d commit dbfdc31
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions packages/jest-haste-map/src/lib/__tests__/docblock-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,4 +123,14 @@ describe('docblock', () => {
'preserve-whitespace': '',
});
});

it('supports slashes in @providesModule directive', () => {
const code =
'/**' + os.EOL + '' +
' * @providesModule apple/banana' + os.EOL + '' +
' */';
expect(docblock.parse(code)).toEqual({
'providesModule': 'apple/banana',
});
});
});
2 changes: 1 addition & 1 deletion packages/jest-haste-map/src/lib/docblock.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
const commentEndRe = /\*\/$/;
const commentStartRe = /^\/\*\*/;
const docblockRe = /^\s*(\/\*\*?(.|\r?\n)*?\*\/)/;
const lineCommentRe = /\/\/*([^\r\n]*)/g;
const lineCommentRe = /\/\/([^\r\n]*)/g;
const ltrimRe = /^\s*/;
const multilineRe =
/(?:^|\r?\n) *(@[^\r\n]*?) *\r?\n *([^@\r\n\s][^@\r\n]+?) *\r?\n/g;
Expand Down

0 comments on commit dbfdc31

Please sign in to comment.