Commit 2e40ee81 authored by Dmitry Shibanov's avatar Dmitry Shibanov
Browse files

suppress tests log output

parent c21fb939
Loading
Loading
Loading
Loading
+4
Changes for __tests__/auth.test.ts: 4 added lines, 0 removed lines.
Original line number Diff line number Diff line
import io = require('@actions/io');
import fs = require('fs');
import path = require('path');
import * as core from '@actions/core';
import os from 'os';

import * as auth from '../src/auth';
@@ -10,11 +11,14 @@ const settingsFile = path.join(m2Dir, auth.SETTINGS_FILE);

describe('auth tests', () => {
  let spyOSHomedir: jest.SpyInstance;
  let spyInfo: jest.SpyInstance;

  beforeEach(async () => {
    await io.rmRF(m2Dir);
    spyOSHomedir = jest.spyOn(os, 'homedir');
    spyOSHomedir.mockReturnValue(__dirname);
    spyInfo = jest.spyOn(core, 'info');
    spyInfo.mockImplementation(() => null);
  }, 300000);

  afterAll(async () => {
+13
Changes for __tests__/cache.test.ts: 13 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -14,6 +14,8 @@ describe('dependency cache', () => {
  let workspace: string;
  let spyInfo: jest.SpyInstance<void, Parameters<typeof core.info>>;
  let spyWarning: jest.SpyInstance<void, Parameters<typeof core.warning>>;
  let spyDebug: jest.SpyInstance<void, Parameters<typeof core.debug>>;
  let spySaveState: jest.SpyInstance<void, Parameters<typeof core.saveState>>;

  beforeEach(() => {
    workspace = mkdtempSync(join(tmpdir(), 'setup-java-cache-'));
@@ -38,7 +40,16 @@ describe('dependency cache', () => {

  beforeEach(() => {
    spyInfo = jest.spyOn(core, 'info');
    spyInfo.mockImplementation(() => null);

    spyWarning = jest.spyOn(core, 'warning');
    spyWarning.mockImplementation(() => null);

    spyDebug = jest.spyOn(core, 'debug');
    spyDebug.mockImplementation(() => null);

    spySaveState = jest.spyOn(core, 'saveState');
    spySaveState.mockImplementation(() => null);
  });

  afterEach(() => {
@@ -58,6 +69,7 @@ describe('dependency cache', () => {
      spyCacheRestore = jest
        .spyOn(cache, 'restoreCache')
        .mockImplementation((paths: string[], primaryKey: string) => Promise.resolve(undefined));
      spyWarning.mockImplementation(() => null);
    });

    it('throws error if unsupported package manager specified', () => {
@@ -117,6 +129,7 @@ describe('dependency cache', () => {
      spyCacheSave = jest
        .spyOn(cache, 'saveCache')
        .mockImplementation((paths: string[], key: string) => Promise.resolve(0));
      spyWarning.mockImplementation(() => null);
    });

    it('throws error if unsupported package manager specified', () => {