@defra-fish/dynamics-lib 1.38.0-rc.2 → 1.38.0-rc.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@defra-fish/dynamics-lib",
|
|
3
|
-
"version": "1.38.0-rc.
|
|
3
|
+
"version": "1.38.0-rc.3",
|
|
4
4
|
"description": "Framework to support integration with dynamics",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -43,5 +43,5 @@
|
|
|
43
43
|
"simple-oauth2": "^4.3.0",
|
|
44
44
|
"uuid": "^8.3.2"
|
|
45
45
|
},
|
|
46
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "d34a0c32144cade57fd6c760513b71428149e7c6"
|
|
47
47
|
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import Path from 'path'
|
|
2
|
+
jest.mock('path')
|
|
3
|
+
const realPath = jest.requireActual('path')
|
|
4
|
+
|
|
5
|
+
describe('project', () => {
|
|
6
|
+
beforeEach(jest.clearAllMocks)
|
|
7
|
+
|
|
8
|
+
it('provides root export', () => {
|
|
9
|
+
jest.isolateModules(() => {
|
|
10
|
+
const rootPath = Symbol('rootPath')
|
|
11
|
+
Path.join.mockReturnValueOnce(rootPath)
|
|
12
|
+
const prj = require('../project.cjs')
|
|
13
|
+
expect(prj.root).toBe(rootPath)
|
|
14
|
+
})
|
|
15
|
+
})
|
|
16
|
+
|
|
17
|
+
it('recurses from __dirname', () => {
|
|
18
|
+
jest.isolateModules(() => {
|
|
19
|
+
const expectedDirName = jest.requireActual('path').join(__dirname, '..')
|
|
20
|
+
require('../project.cjs')
|
|
21
|
+
expect(Path.join).toHaveBeenCalledWith(expectedDirName, '..')
|
|
22
|
+
})
|
|
23
|
+
})
|
|
24
|
+
|
|
25
|
+
it('provides package json path', () => {
|
|
26
|
+
jest.isolateModules(() => {
|
|
27
|
+
const mockModule = {
|
|
28
|
+
name: 'mocked-package',
|
|
29
|
+
version: '1.0.0'
|
|
30
|
+
}
|
|
31
|
+
jest.mock(`${realPath.join(__dirname, '../..')}/package.json`, () => mockModule)
|
|
32
|
+
Path.join.mockReturnValueOnce(null).mockReturnValueOnce(`${realPath.join(__dirname, '../..')}/package.json`)
|
|
33
|
+
const { packageJson } = require('../project.cjs')
|
|
34
|
+
expect(packageJson).toBe(mockModule)
|
|
35
|
+
})
|
|
36
|
+
})
|
|
37
|
+
})
|