From: Justin Wind Date: Sat, 4 May 2024 20:34:21 +0000 (-0700) Subject: add test for root level X-Git-Tag: v1.0.1~1 X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=7cca5d74509582613b2007d5d75d727a1e3b2f92;p=squeep-log-helper add test for root level --- diff --git a/test/lib/file-scope.js b/test/lib/file-scope.js index b8fc123..4474911 100644 --- a/test/lib/file-scope.js +++ b/test/lib/file-scope.js @@ -276,6 +276,17 @@ describe('File Scope', function () { assert.strictEqual(result, 'deep:method'); }); + it('handles package root file', function () { + filepath = '/path/to/package/server.js'; + fs.statSync.restore(); + sinon.stub(fs, 'statSync') + .throws(noentError) + .onCall(0).returns() // packageBase found + ; + const result = fileScope(filepath)(method); + assert.strictEqual(result, 'server:method'); + }); + }); // fileScope