xref: /third_party/node/test/parallel/test-process-assert.js
  • Home
  • History
  • Annotate Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /third_party/node/test/parallel/
11cb0ef41Sopenharmony_ci'use strict';
21cb0ef41Sopenharmony_ciconst common = require('../common');
31cb0ef41Sopenharmony_ciconst assert = require('assert');
41cb0ef41Sopenharmony_ci
51cb0ef41Sopenharmony_cicommon.expectWarning(
61cb0ef41Sopenharmony_ci  'DeprecationWarning',
71cb0ef41Sopenharmony_ci  'process.assert() is deprecated. Please use the `assert` module instead.',
81cb0ef41Sopenharmony_ci  'DEP0100'
91cb0ef41Sopenharmony_ci);
101cb0ef41Sopenharmony_ci
111cb0ef41Sopenharmony_ciassert.strictEqual(process.assert(1, 'error'), undefined);
121cb0ef41Sopenharmony_ciassert.throws(() => {
131cb0ef41Sopenharmony_ci  process.assert(undefined, 'errorMessage');
141cb0ef41Sopenharmony_ci}, {
151cb0ef41Sopenharmony_ci  code: 'ERR_ASSERTION',
161cb0ef41Sopenharmony_ci  name: 'Error',
171cb0ef41Sopenharmony_ci  message: 'errorMessage'
181cb0ef41Sopenharmony_ci});
191cb0ef41Sopenharmony_ciassert.throws(() => {
201cb0ef41Sopenharmony_ci  process.assert(false);
211cb0ef41Sopenharmony_ci}, {
221cb0ef41Sopenharmony_ci  code: 'ERR_ASSERTION',
231cb0ef41Sopenharmony_ci  name: 'Error',
241cb0ef41Sopenharmony_ci  message: 'assertion error'
251cb0ef41Sopenharmony_ci});
26

Indexes created Thu Nov 07 10:32:03 CST 2024