mirror of https://github.com/actions/toolkit
Mock output during tests to reduce noise
parent
d472b2ce20
commit
6e3bcd2f1f
|
@ -1,4 +1,5 @@
|
||||||
import * as path from 'path'
|
import * as path from 'path'
|
||||||
|
import * as core from '@actions/core'
|
||||||
import {URL} from 'url'
|
import {URL} from 'url'
|
||||||
import {getDownloadSpecification} from '../src/internal-download-specification'
|
import {getDownloadSpecification} from '../src/internal-download-specification'
|
||||||
import {ContainerEntry} from '../src/internal-contracts'
|
import {ContainerEntry} from '../src/internal-contracts'
|
||||||
|
@ -108,6 +109,14 @@ const artifactContainerEntries: ContainerEntry[] = [
|
||||||
]
|
]
|
||||||
|
|
||||||
describe('Search', () => {
|
describe('Search', () => {
|
||||||
|
beforeAll(async () => {
|
||||||
|
// mock all output so that there is less noise when running tests
|
||||||
|
jest.spyOn(console, 'log').mockImplementation(() => {})
|
||||||
|
jest.spyOn(core, 'debug').mockImplementation(() => {})
|
||||||
|
jest.spyOn(core, 'info').mockImplementation(() => {})
|
||||||
|
jest.spyOn(core, 'warning').mockImplementation(() => {})
|
||||||
|
})
|
||||||
|
|
||||||
it('Download Specification - Absolute Path with no root directory', () => {
|
it('Download Specification - Absolute Path with no root directory', () => {
|
||||||
const testDownloadPath = path.join(
|
const testDownloadPath = path.join(
|
||||||
__dirname,
|
__dirname,
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
import * as core from '@actions/core'
|
||||||
import * as http from 'http'
|
import * as http from 'http'
|
||||||
import * as io from '../../io/src/io'
|
import * as io from '../../io/src/io'
|
||||||
import * as net from 'net'
|
import * as net from 'net'
|
||||||
|
@ -18,6 +19,12 @@ jest.mock('@actions/http-client')
|
||||||
describe('Download Tests', () => {
|
describe('Download Tests', () => {
|
||||||
beforeAll(async () => {
|
beforeAll(async () => {
|
||||||
await io.rmRF(root)
|
await io.rmRF(root)
|
||||||
|
|
||||||
|
// mock all output so that there is less noise when running tests
|
||||||
|
jest.spyOn(console, 'log').mockImplementation(() => {})
|
||||||
|
jest.spyOn(core, 'debug').mockImplementation(() => {})
|
||||||
|
jest.spyOn(core, 'info').mockImplementation(() => {})
|
||||||
|
jest.spyOn(core, 'warning').mockImplementation(() => {})
|
||||||
})
|
})
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue