summaryrefslogtreecommitdiff
path: root/test/parallel/test-assert-first-line.js
blob: 32eadbf74156c38bd087e78ee3ef4eee949fdfc7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
'use strict';

// Verify that asserting in the very first line produces the expected result.

require('../common');
const assert = require('assert');
const { path } = require('../common/fixtures');

assert.throws(
  () => require(path('assert-first-line')),
  {
    name: 'AssertionError [ERR_ASSERTION]',
    message: "The expression evaluated to a falsy value:\n\n  ässört.ok('')\n"
  }
);

assert.throws(
  () => require(path('assert-long-line')),
  {
    name: 'AssertionError [ERR_ASSERTION]',
    message: "The expression evaluated to a falsy value:\n\n  assert.ok('')\n"
  }
);