2018-07-02 20:29:57 +02:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
// Verify that asserting in the very first line produces the expected result.
|
|
|
|
|
|
|
|
require('../common');
|
|
|
|
const assert = require('assert');
|
2024-08-26 22:08:07 -07:00
|
|
|
const { test } = require('node:test');
|
2018-07-02 20:29:57 +02:00
|
|
|
const { path } = require('../common/fixtures');
|
|
|
|
|
2024-08-26 22:08:07 -07:00
|
|
|
test('Verify that asserting in the very first line produces the expected result', () => {
|
|
|
|
assert.throws(
|
|
|
|
() => require(path('assert-first-line')),
|
|
|
|
{
|
|
|
|
name: 'AssertionError',
|
|
|
|
message: "The expression evaluated to a falsy value:\n\n ässört.ok('')\n"
|
|
|
|
}
|
|
|
|
);
|
2018-07-02 20:29:57 +02:00
|
|
|
|
2024-08-26 22:08:07 -07:00
|
|
|
assert.throws(
|
|
|
|
() => require(path('assert-long-line')),
|
|
|
|
{
|
|
|
|
name: 'AssertionError',
|
|
|
|
message: "The expression evaluated to a falsy value:\n\n assert.ok('')\n"
|
|
|
|
}
|
|
|
|
);
|
|
|
|
});
|