Skip to content
Permalink
Browse files

Merge 08559c2 into 5e143b2

  • Loading branch information
AamuLumi committed Oct 1, 2019
2 parents 5e143b2 + 08559c2 commit 755b02a470260adcb0c8c0c9e3ce286f42bcce76
Showing with 2 additions and 2 deletions.
  1. +1 −1 src/core/importType.js
  2. +1 −1 tests/src/core/importType.js
@@ -43,7 +43,7 @@ export function isExternalModuleMain(name, settings, path) {
return externalModuleMainRegExp.test(name) && isExternalPath(path, name, settings)
}

const scopedRegExp = /^@[^/]+\/[^/]+/
const scopedRegExp = /^@[^/]+\/?[^/]+/
function isScoped(name) {
return scopedRegExp.test(name)
}
@@ -55,6 +55,7 @@ describe('importType(name)', function () {
it("should return 'internal' for internal modules that are referenced by aliases", function () {
const pathContext = testContext({ 'import/resolver': { node: { paths: [pathToTestFiles] } } })
expect(importType('@my-alias/fn', pathContext)).to.equal('internal')
expect(importType('@importType', pathContext)).to.equal('internal')
})

it("should return 'internal' for aliased internal modules that look like core modules (node resolver)", function () {
@@ -96,7 +97,6 @@ describe('importType(name)', function () {
})

it("should return 'unknown' for any unhandled cases", function() {
expect(importType('@malformed', context)).to.equal('unknown')
expect(importType(' /malformed', context)).to.equal('unknown')
expect(importType(' foo', context)).to.equal('unknown')
})

0 comments on commit 755b02a

Please sign in to comment.
You can’t perform that action at this time.