From 9b925795fcb5967bd135183b89a6e75b41059a7f Mon Sep 17 00:00:00 2001 From: Wojciech Maj Date: Tue, 2 Jul 2024 14:48:26 +0200 Subject: [PATCH] Add unit tests --- test/rules/one-level/element-types.spec.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/rules/one-level/element-types.spec.js b/test/rules/one-level/element-types.spec.js index 828d193..e666a86 100644 --- a/test/rules/one-level/element-types.spec.js +++ b/test/rules/one-level/element-types.spec.js @@ -166,6 +166,18 @@ const test = (settings, options, errorMessages) => { }, ], }, + // Can import fs module + { + filename: absoluteFilePath("modules/module-a/ModuleA.js"), + code: "import fs from 'fs'", + options, + }, + // Can import node:fs module + { + filename: absoluteFilePath("modules/module-a/ModuleA.js"), + code: "import fs from 'node:fs'", + options, + }, ], invalid: [ // Helpers can't import another if everything is disallowed