Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 13 additions & 8 deletions node_package/tests/bootstrap.config.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ test('createConfig uses default config if user config is not provided', assert =
appStyles: undefined,
useCustomIconFontPath: false,
extractStyles: false,
styleLoaders: ['style', 'css', 'sass'],
styleLoaders: ['style-loader', 'css-loader', 'sass-loader'],
styles: [
'mixins',
'normalize',
Expand Down Expand Up @@ -106,18 +106,23 @@ test('createConfig uses default config if user config is not provided', assert =
});

test('createConfig uses user config as expected', assert => {
const testConfigsDir = path.resolve(__dirname, './test_configs');
const expectedResult = {
appStyles: undefined,
bootstrapCustomizations:
'/home/ubuntu/workspace/node_package/tests' +
'test_configs/path/to/bootstrap/customizations.scss',
bootstrapCustomizations: path.resolve(
testConfigsDir,
'./path/to/bootstrap/customizations.scss'
),
Comment on lines +112 to +115

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Add missing trailing commas flagged by ESLint/Prettier.

Static analysis flags missing trailing commas in the multi-line path.resolve argument lists (lines 114 and 122), which will fail lint/CI.

💚 Proposed fix
     bootstrapCustomizations: path.resolve(
       testConfigsDir,
-      './path/to/bootstrap/customizations.scss'
+      './path/to/bootstrap/customizations.scss',
     ),
     bootstrapVersion: 4,
     configFilePath: path.resolve(testConfigsDir, './test_bootstraprc'),
     extractStyles: true,
     loglevel: undefined,
     preBootstrapCustomizations: path.resolve(
       testConfigsDir,
-      './path/to/bootstrap/pre-customizations.scss'
+      './path/to/bootstrap/pre-customizations.scss',
     ),

Also applies to: 120-123

🧰 Tools
🪛 ESLint

[error] 114-114: Insert ,

(prettier/prettier)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@node_package/tests/bootstrap.config.test.js` around lines 112 - 115, The
multi-line path.resolve argument lists in bootstrap.config.test.js are missing
trailing commas, causing ESLint/Prettier failures. Update the path.resolve calls
that set bootstrapCustomizations and the other affected config path so each
continued argument line ends with a trailing comma, keeping the formatting
consistent with the existing test config style.

Source: Linters/SAST tools

bootstrapVersion: 4,
configFilePath: path.resolve(__dirname, './test_configs/test_bootstraprc'),
configFilePath: path.resolve(testConfigsDir, './test_bootstraprc'),
extractStyles: true,
loglevel: undefined,
preBootstrapCustomizations:
'/home/ubuntu/workspace/node_package/tests' +
'test_configs/path/to/bootstrap/pre-customizations.scss',
preBootstrapCustomizations: path.resolve(
testConfigsDir,
'./path/to/bootstrap/pre-customizations.scss'
),
disableSassSourceMap: undefined,
disableResolveUrlLoader: undefined,
scripts: [
'alert',
'button',
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "Boostrap for Webpack",
"main": "loader.js",
"scripts": {
"test": "babel-tape-runner node_package/tests/**/*.test.js | tap-spec",
"test": "babel-tape-runner \"node_package/tests/**/*.test.js\" | tap-spec",
"start": "npm run lint && npm run clean && npm run dev",
"dev": "babel --watch --out-dir lib src",
"build": "babel --out-dir lib src",
Expand Down