-
Notifications
You must be signed in to change notification settings - Fork 30.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
doc: Fix missing imports in script #49489
Conversation
Review requested:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is also a CJS example on line 920 of the file that needs to be updated as well.
doc/api/test.md
Outdated
const { tap } = require('node:test/reporters'); | ||
const { tap, run } = require('node:test/reporters'); | ||
const process = require('process'); | ||
const path = require('path'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const path = require('path'); | |
const path = require('node:path'); |
doc/api/test.md
Outdated
import process from 'node:process'; | ||
import path from 'path'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import path from 'path'; | |
import path from 'node:path'; |
@OshriAsulin I resolved the suggestions you have fixed, there are two more issues raised that are not taken care of:
|
@aduh95 ok then I guess we should add it to the CJS example |
No, I don't think so, no one said that the examples need to be a line-by-line equivalent, and it's consistent with most snippets in the docs: CJS ones rely on |
@OshriAsulin The commit message of first commit should be changed to start with lower case character after the submodule ( Could you rebase and change commit message? |
I'd suggest using |
The script was missing necessary imports for the `run` function and the `path` module, causing it to fail. This commit adds the missing imports and resolves the issue. - Import `run` from the appropriate module. - Import `path` to resolve file paths. The script should now run without errors.
This commit enhances the script by addressing missing imports for the 'run' function and the 'path' module, which previously resulted in script failure. The following improvements have been made: Imported 'run' from the appropriate module via require to ensure correct functionality. Imported 'path' via require to facilitate proper file path resolution. Imported 'process' via require to include this essential module. These changes resolve the issue of missing dependencies execution.
In this commit, I've refactored the import statements and destructuring assignments in the codebase to enhance code organization and maintainability. The primary changes are as follows: 1. Replaced the import statement: - From: `import { tap, run } from 'node:test/reporters';` - To: - `import { run } from 'node:test';` - `import { tap } from 'node:test/reporters';` 2. Reorganized destructuring assignments: - From: ``` const { tap, run } = require('node:test/reporters'); const process = require('process'); ``` - To: ``` const { run } = require('node:test'); const { tap } = require('node:test/reporters'); ```
In this commit, I update import and require statements throughout the codebase to use 'node:path' instead of 'path'.
Landed in 6919d72 |
@OshriAsulin thanks for your contribution! |
The script was missing necessary imports for the `run` function and the `path` module, causing it to fail. This commit adds the missing imports and resolves the issue. - Import `run` from the appropriate module. - Import `path` to resolve file paths. The script should now run without errors. PR-URL: #49489 Fixes: #49488 Reviewed-By: Chemi Atlow <chemi@atlow.co.il> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
The script was missing necessary imports for the `run` function and the `path` module, causing it to fail. This commit adds the missing imports and resolves the issue. - Import `run` from the appropriate module. - Import `path` to resolve file paths. The script should now run without errors. PR-URL: nodejs#49489 Fixes: nodejs#49488 Reviewed-By: Chemi Atlow <chemi@atlow.co.il> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Fixes: #49488
The script was missing necessary imports for the 'run' function and the 'path' module, causing it to fail. This commit adds the missing imports and resolves the issue.
The script should now run without errors.