Skip to content

Commit

Permalink
Enabled external hooks test
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian Vaughn committed Jul 1, 2021
1 parent 78b21a1 commit b9b9131
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,7 @@ describe('parseHookNames', () => {
await test('./__source__/__compiled__/external/ComponentWithCustomHook'); // external source map
});

// TODO (named hooks) The useContext() line number is slightly off
xit('should work for external hooks', async () => {
it('should work for external hooks', async () => {
async function test(path) {
const Component = require(path).Component;
const hookNames = await getHookNamesForComponent(Component);
Expand All @@ -257,7 +256,9 @@ describe('parseHookNames', () => {
]);
}

await test('./__source__/ComponentWithExternalCustomHooks'); // original source (uncompiled)
// We can't test the uncompiled source here, because it either needs to get transformed,
// which would break the source mapping, or the import statements will fail.

await test(
'./__source__/__compiled__/inline/ComponentWithExternalCustomHooks',
); // inline source map
Expand Down

0 comments on commit b9b9131

Please sign in to comment.