Unverified Commit 4c6c9cc8 authored by Joe Haddad's avatar Joe Haddad Committed by GitHub

Add telemetry CLI tests (#8696)

* Add telemetry CLI tests

* Apply suggestions from code review
Co-Authored-By: 's avatarJJ Kasper <jj@jjsweb.site>

* Update index.test.js
parent ba683b3f
export default () => 'Hello World'
/* eslint-env jest */
/* global jasmine */
import { runNextCommand } from 'next-test-utils'
jasmine.DEFAULT_TIMEOUT_INTERVAL = 1000 * 60 * 2
describe('Telemetry CLI', () => {
it('can print telemetry status', async () => {
const { stdout } = await runNextCommand(['telemetry'], {
stdout: true
})
expect(stdout).toMatch(/Status: .*/)
})
it('can enable telemetry', async () => {
const { stdout } = await runNextCommand(['telemetry', '--enable'], {
stdout: true
})
expect(stdout).toMatch(/Success/)
expect(stdout).toMatch(/Status: Enabled/)
})
it('can disable telemetry', async () => {
const { stdout } = await runNextCommand(['telemetry', '--disable'], {
stdout: true
})
expect(stdout).toMatch(/Your preference has been saved/)
expect(stdout).toMatch(/Status: Disabled/)
})
})
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment