Add relative path cache spec

Esse commit está contido em:
Kevin Sawicki
2014-10-13 16:25:58 -04:00
commit 826681b6c2
2 arquivos alterados com 15 adições e 0 exclusões
+3
Ver Arquivo
@@ -0,0 +1,3 @@
{
"foo": "bar"
}
+12
Ver Arquivo
@@ -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