node/test/parallel/test-assert-first-line.js
Antoine du Hamel 0457bfee2c
test: forbid use of named imports for fixtures
PR-URL: https://github.com/nodejs/node/pull/61228
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: René <contact.9a5d6388@renegade334.me.uk>
2026-01-01 23:48:26 +00:00

26 lines
734 B
JavaScript

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