Add relative path cache spec
Esse commit está contido em:
+3
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"foo": "bar"
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
path = require 'path'
|
||||
Module = require 'module'
|
||||
ModuleCache = require '../src/module-cache'
|
||||
|
||||
describe 'ModuleCache', ->
|
||||
beforeEach ->
|
||||
@@ -8,3 +9,14 @@ describe 'ModuleCache', ->
|
||||
it 'resolves atom shell module paths without hitting the filesystem', ->
|
||||
require.resolve('shell')
|
||||
expect(Module._findPath.callCount).toBe 0
|
||||
|
||||
it 'resolves relative core paths without hitting the filesystem', ->
|
||||
ModuleCache.add atom.getLoadSettings().resourcePath, {
|
||||
_atomModuleCache:
|
||||
extensions:
|
||||
'.json': [
|
||||
path.join('spec', 'fixtures', 'module-cache', 'file.json')
|
||||
]
|
||||
}
|
||||
expect(require('./fixtures/module-cache/file.json').foo).toBe 'bar'
|
||||
expect(Module._findPath.callCount).toBe 0
|
||||
|
||||
Referência em uma Nova Issue
Bloquear um usuário