wallabyjs / public

Repository for Wallaby.js questions and issues
http://wallabyjs.com
760 stars 45 forks source link

Suppress node warnings #3185

Closed polRk closed 1 year ago

polRk commented 1 year ago

Issue description or question

Now I see a warning message when running tests. I want to turn off this warnings. https://github.com/nodejs/node/blob/main/doc/api/cli.md#--no-warnings

    env: {
      type: 'node',
      params: { runner: '--experimental-loader=file://<homeDir>/.vscode/extensions/wallabyjs.wallaby-vscode-1.0.350/wallaby9143c8/runners/node/hooks.mjs' },
      runner: '/opt/homebrew/Cellar/node@18/18.15.0/bin/node',
      bundle: true
    },

Wallaby diagnostics report

{
  editorVersion: '1.75.1',
  pluginVersion: '1.0.350',
  editorType: 'VSCode',
  osVersion: 'darwin 22.3.0',
  nodeVersion: 'v18.15.0',
  coreVersion: '1.0.1396',
  checksum: 'YzhmY2QyYTM2OTZiNWU5ZTlmYWI1YzI3NTg1ODhmNzYsMTcwMzM3NjAwMDAwMCww',
  config: {
    diagnostics: {
      vitest: {
        file: {
          config: '/// <reference types="vitest" />\n' +
            "import { defineConfig } from 'vite'\n" +
            '\n' +
            "const isCI = process.env['CI'] === 'true'\n" +
            '\n' +
            'export default defineConfig({\n' +
            "\tcacheDir: '../../node_modules/.vite/proxy',\n" +
            '\n' +
            '\ttest: {\n' +
            "\t\tenvironment: 'miniflare',\n" +
            '\t\tenvironmentOptions: {\n' +
            '\t\t\tmodules: true,\n' +
            "\t\t\tscriptPath: './src/index.ts',\n" +
            '\t\t\tmounts: {\n' +
            '\t\t\t\tapi: {\n' +
            "\t\t\t\t\trootPath: '../api',\n" +
            '\t\t\t\t},\n' +
            '\t\t\t},\n' +
            '\t\t},\n' +
            '\t\twatch: false,\n' +
            '\t\tcache: {\n' +
            "\t\t\tdir: '../../node_modules/.vitest',\n" +
            '\t\t},\n' +
            "\t\tinclude: ['src/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],\n" +
            '\t\tsilent: isCI,\n' +
            "\t\treporters: isCI ? 'tap' : 'default',\n" +
            '\t\tcoverage: {\n' +
            '\t\t\tclean: true,\n' +
            '\t\t\tenabled: isCI,\n' +
            "\t\t\treporter: isCI ? ['lcov', 'json-summary', 'text-summary'] : 'text',\n" +
            '\t\t},\n' +
            '\t},\n' +
            '})\n'
        },
        config: {
          allowOnly: true,
          watch: false,
          globals: false,
          environment: 'miniflare',
          threads: true,
          clearMocks: false,
          restoreMocks: false,
          mockReset: false,
          include: [ 'src/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}' ],
          exclude: [
            '**/node_modules/**',
            '**/dist/**',
            '**/cypress/**',
            '**/.{idea,git,cache,output,temp}/**',
            '**/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress,tsup,build}.config.*'
          ],
          testTimeout: 5000,
          hookTimeout: 10000,
          teardownTimeout: 10000,
          isolate: true,
          watchExclude: [ '**/node_modules/**', '**/dist/**' ],
          forceRerunTriggers: [ '**/package.json/**', '**/{vitest,vite}.config.*/**' ],
          update: false,
          reporters: [ 'default' ],
          silent: false,
          ui: false,
          uiBase: '/__vitest__/',
          open: true,
          css: { include: [], modules: { classNameStrategy: 'stable' } },
          coverage: {
            provider: 'c8',
            enabled: false,
            clean: true,
            cleanOnRerun: true,
            reportsDirectory: './coverage',
            exclude: [
              'coverage/**',
              'dist/**',
              'packages/*/test{,s}/**',
              '**/*.d.ts',
              'cypress/**',
              'test{,s}/**',
              'test{,-*}.{js,cjs,mjs,ts,tsx,jsx}',
              '**/*{.,-}test.{js,cjs,mjs,ts,tsx,jsx}',
              '**/*{.,-}spec.{js,cjs,mjs,ts,tsx,jsx}',
              '**/__tests__/**',
              '**/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress,tsup,build}.config.*',
              '**/.{eslint,mocha,prettier}rc.{js,cjs,yml}'
            ],
            reporter: 'text',
            extension: [
              '.js',  '.cjs',
              '.mjs', '.ts',
              '.mts', '.cts',
              '.tsx', '.jsx',
              '.vue', '.svelte'
            ]
          },
          fakeTimers: { loopLimit: 10000, shouldClearNativeTimers: true, toFake: [ 'setTimeout', 'clearTimeout', 'setInterval', 'clearInterval', 'setImmediate', 'clearImmediate', 'Date' ] },
          maxConcurrency: 5,
          dangerouslyIgnoreUnhandledErrors: false,
          typecheck: {
            checker: 'tsc',
            include: [ '**/*.{test,spec}-d.{ts,js}' ],
            exclude: [
              '**/node_modules/**',
              '**/dist/**',
              '**/cypress/**',
              '**/.{idea,git,cache,output,temp}/**',
              '**/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress,tsup,build}.config.*'
            ]
          },
          slowTestThreshold: 300,
          environmentOptions: { modules: true, scriptPath: './src/index.ts', mounts: { api: { rootPath: '../api' } } },
          cache: { dir: '<homeDir>/Developer/github.com/glocal/gloc.al/node_modules/.vitest' },
          run: true,
          defines: {},
          root: '<homeDir>/Developer/github.com/glocal/gloc.al/apps/proxy',
          mode: [],
          deps: { inline: [ {}, {}, {}, '@nuxt/test-utils' ], registerNodeLoader: false },
          snapshotOptions: { snapshotFormat: {}, updateSnapshot: 'new' },
          setupFiles: [],
          sequence: { hooks: 'parallel' },
          environmentMatchGlobs: [],
          package: {
            version: '0.28.5',
            urls: { hooks: 'file://<homeDir>/.vscode/extensions/wallabyjs.wallaby-vscode-1.0.350/wallaby9143c8/runners/node/hooks.mjs' },
            paths: { root: '<homeDir>/Developer/github.com/glocal/gloc.al/node_modules/vitest', dist: '<homeDir>/Developer/github.com/glocal/gloc.al/node_modules/vitest/dist' }
          }
        }
      }
    },
    testFramework: { version: 'vitest@0.14.0', configurator: 'vitest@0.14.0', reporter: 'vitest@0.14.0', starter: 'vitest@0.14.0', autoDetected: true },
    preserveComments: false,
    extractComments: true,
    files: [
      { pattern: 'src/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}', ignore: true, trigger: true, load: true, file: true },
      { pattern: '**/node_modules/**', ignore: true, trigger: true, load: true, file: true, test: true },
      { pattern: '**/dist/**', ignore: true, trigger: true, load: true, file: true, test: true },
      { pattern: '**/cypress/**', ignore: true, trigger: true, load: true, file: true, test: true },
      { pattern: '**/.{idea,git,cache,output,temp}/**', ignore: true, trigger: true, load: true, file: true, test: true },
      { pattern: '**/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress,tsup,build}.config.*', ignore: true, trigger: true, load: true, file: true, test: true },
      { pattern: '**/*.*', ignore: false, trigger: true, load: true, order: 1 }
    ],
    tests: [
      { pattern: '**/node_modules/**', ignore: true, trigger: true, load: true, test: true, file: false },
      { pattern: '**/dist/**', ignore: true, trigger: true, load: true, test: true, file: false },
      { pattern: '**/cypress/**', ignore: true, trigger: true, load: true, test: true, file: false },
      { pattern: '**/.{idea,git,cache,output,temp}/**', ignore: true, trigger: true, load: true, test: true, file: false },
      { pattern: '**/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress,tsup,build}.config.*', ignore: true, trigger: true, load: true, test: true, file: false },
      { pattern: 'src/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}', ignore: false, trigger: true, load: true, test: true, order: 2 }
    ],
    workers: { initial: 1, regular: 1, recycle: false },
    filesWithNoCoverageCalculated: [],
    runAllTestsInAffectedTestFile: false,
    updateNoMoreThanOneSnapshotPerTestFileRun: false,
    compilers: {},
    logLimits: { inline: { depth: 5, elements: 5000 }, values: { default: { stringLength: 200 }, autoExpand: { elements: 5000, stringLength: 8192, depth: 10 } } },
    preprocessors: {},
    maxConsoleMessagesPerTest: 100,
    autoConsoleLog: true,
    delays: { run: 0, edit: 100, update: 0 },
    teardown: undefined,
    hints: {
      ignoreCoverage: '__REGEXP /ignore coverage|istanbul ignore/',
      ignoreCoverageForFile: '__REGEXP /ignore file coverage/',
      commentAutoLog: '?',
      testFileSelection: { include: '__REGEXP /file\\.only/', exclude: '__REGEXP /file\\.skip/' }
    },
    automaticTestFileSelection: true,
    runSelectedTestsOnly: false,
    mapConsoleMessagesStackTrace: false,
    extensions: {},
    env: {
      type: 'node',
      params: { runner: '--experimental-loader=file://<homeDir>/.vscode/extensions/wallabyjs.wallaby-vscode-1.0.350/wallaby9143c8/runners/node/hooks.mjs' },
      runner: '/opt/homebrew/Cellar/node@18/18.15.0/bin/node',
      viewportSize: { width: 800, height: 600 },
      options: { width: 800, height: 600 },
      bundle: true
    },
    reportUnhandledPromises: true,
    slowTestThreshold: 75,
    lowCoverageThreshold: 80,
    runAllTestsWhenNoAffectedTests: true,
    symlinkNodeModules: true,
    configCode: 'auto.detect#-223489919'
  },
  packageJSON: {
    dependencies: { '@tinkoff/utils': '2.3.2', '@trpc/client': '10.15.0', '@trpc/server': '10.15.0', 'accept-language-parser': '1.5.0', isbot: '3.6.6', 'toucan-js': '3.1.0' },
    devDependencies: { '@types/accept-language-parser': '1.5.3' }
  },
  fs: { numberOfFiles: 32 },
  debug: []
}
polRk commented 1 year ago

Oh, i see if i start my tests via vitest, no wallaby. Close it