Skip to content

test: use common.fixtures.path() #16109

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

Closed
wants to merge 1 commit into from
Closed
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
5 changes: 3 additions & 2 deletions test/parallel/test-fs-readfile-fd.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
'use strict';
const common = require('../common');
require('../common');
const fixturesPath = require('../common/fixtures').path();
Copy link
Member

Choose a reason for hiding this comment

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

This is close, but would be better as:

const fixtures = require('../common/fixtures');

then ...

const fn = fixtures.path('empty.txt');

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay!

Here is another one:
#16112

Copy link
Contributor

Choose a reason for hiding this comment

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

@tobbik, I'm going to close this one in favor of #16112 then. Just for future reference, you can update an existing PR by pushing changes to the corresponding branch on your GitHub.

const assert = require('assert');
const path = require('path');
const fs = require('fs');
const fn = path.join(common.fixturesDir, 'empty.txt');
const fn = path.join(fixturesPath, 'empty.txt');

tempFd(function(fd, close) {
fs.readFile(fd, function(err, data) {
Expand Down