summaryrefslogtreecommitdiff
path: root/test/parallel/test-assert-first-line.js
blob: f9d4a8b06cbea064f213f4564908f42857ce24bf (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',
    message: "The expression evaluated to a falsy value:\n\n  ässört.ok('')\n"
  }
);

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