11cb0ef41Sopenharmony_ci'use strict';
21cb0ef41Sopenharmony_ci
31cb0ef41Sopenharmony_ciconst common = require('../common');
41cb0ef41Sopenharmony_ciconst assert = require('assert');
51cb0ef41Sopenharmony_ci
61cb0ef41Sopenharmony_ci// No args
71cb0ef41Sopenharmony_ciassert.throws(
81cb0ef41Sopenharmony_ci  () => { assert.fail(); },
91cb0ef41Sopenharmony_ci  {
101cb0ef41Sopenharmony_ci    code: 'ERR_ASSERTION',
111cb0ef41Sopenharmony_ci    name: 'AssertionError',
121cb0ef41Sopenharmony_ci    message: 'Failed',
131cb0ef41Sopenharmony_ci    operator: 'fail',
141cb0ef41Sopenharmony_ci    actual: undefined,
151cb0ef41Sopenharmony_ci    expected: undefined,
161cb0ef41Sopenharmony_ci    generatedMessage: true,
171cb0ef41Sopenharmony_ci    stack: /Failed/
181cb0ef41Sopenharmony_ci  }
191cb0ef41Sopenharmony_ci);
201cb0ef41Sopenharmony_ci
211cb0ef41Sopenharmony_ci// One arg = message
221cb0ef41Sopenharmony_ciassert.throws(() => {
231cb0ef41Sopenharmony_ci  assert.fail('custom message');
241cb0ef41Sopenharmony_ci}, {
251cb0ef41Sopenharmony_ci  code: 'ERR_ASSERTION',
261cb0ef41Sopenharmony_ci  name: 'AssertionError',
271cb0ef41Sopenharmony_ci  message: 'custom message',
281cb0ef41Sopenharmony_ci  operator: 'fail',
291cb0ef41Sopenharmony_ci  actual: undefined,
301cb0ef41Sopenharmony_ci  expected: undefined,
311cb0ef41Sopenharmony_ci  generatedMessage: false
321cb0ef41Sopenharmony_ci});
331cb0ef41Sopenharmony_ci
341cb0ef41Sopenharmony_ci// One arg = Error
351cb0ef41Sopenharmony_ciassert.throws(() => {
361cb0ef41Sopenharmony_ci  assert.fail(new TypeError('custom message'));
371cb0ef41Sopenharmony_ci}, {
381cb0ef41Sopenharmony_ci  name: 'TypeError',
391cb0ef41Sopenharmony_ci  message: 'custom message'
401cb0ef41Sopenharmony_ci});
411cb0ef41Sopenharmony_ci
421cb0ef41Sopenharmony_ciObject.prototype.get = common.mustNotCall();
431cb0ef41Sopenharmony_ciassert.throws(() => assert.fail(''), { code: 'ERR_ASSERTION' });
441cb0ef41Sopenharmony_cidelete Object.prototype.get;
45