Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
"bugs": "https://github.com/adobe/aio-cli-plugin-telemetry/issues",
"dependencies": {
"@adobe/aio-lib-core-config": "^5",
"@adobe/aio-lib-core-networking": "^5.0.4",
"@oclif/core": "^1.3.4",
"ci-info": "^4.0.0",
"debug": "^4.1.1",
"inquirer": "^8.2.1",
"node-fetch": "^2.6.7",
"os-name": "^4.0.1",
"splunk-logging": "^0.11.1"
},
Expand Down
4 changes: 3 additions & 1 deletion src/telemetry-lib.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ OF ANY KIND, either express or implied. See the License for the specific languag
governing permissions and limitations under the License.
*/

const fetch = require('node-fetch')
const { createFetch } = require('@adobe/aio-lib-core-networking')
const config = require('@adobe/aio-lib-core-config')

const fetch = createFetch()
const osName = require('os-name')
const inquirer = require('inquirer')
const debug = require('debug')('aio-telemetry:telemetry-lib')
Expand Down
4 changes: 3 additions & 1 deletion test/hooks.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@
* governing permissions and limitations under the License.
*/

const fetch = require('node-fetch')
const { createFetch } = require('@adobe/aio-lib-core-networking')
const inquirer = require('inquirer')
const config = require('@adobe/aio-lib-core-config')

jest.mock('inquirer')
jest.mock('@adobe/aio-lib-core-config')

const fetch = createFetch()

const mockPackageJson = {
bin: { aio: '' },
name: 'name',
Expand Down
3 changes: 2 additions & 1 deletion test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@
* governing permissions and limitations under the License.
*/

const fetch = require('node-fetch')
const { createFetch } = require('@adobe/aio-lib-core-networking')
const TheCommand = require('../src/commands/telemetry')
const { stdout } = require('stdout-stderr')

jest.mock('inquirer')

const fetch = createFetch()
let command

beforeEach(() => {
Expand Down
6 changes: 4 additions & 2 deletions test/jest.setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ const { vol } = require('memfs')
jest.setTimeout(3000)
jest.useFakeTimers()

const fetch = require('jest-fetch-mock')
jest.setMock('node-fetch', fetch)
const mockFetch = require('jest-fetch-mock')
jest.mock('@adobe/aio-lib-core-networking', () => ({
createFetch: jest.fn(() => mockFetch)
}))

vol.reset()

Expand Down
4 changes: 3 additions & 1 deletion test/telemetry-lib.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@
* governing permissions and limitations under the License.
*/

const fetch = require('node-fetch')
const { createFetch } = require('@adobe/aio-lib-core-networking')
const telemetryLib = require('../src/telemetry-lib')
const config = require('@adobe/aio-lib-core-config')

jest.mock('@adobe/aio-lib-core-config')

const fetch = createFetch()

describe('telemetry-lib', () => {
beforeEach(() => {
jest.resetModules()
Expand Down