Skip to content

Commit

Permalink
fixed lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Annosha committed Oct 19, 2024
1 parent a13d2ec commit 78299e2
Showing 1 changed file with 25 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,10 @@ describe('RequireInTheMiddleSingleton', () => {
'codecov/lib/codecov.js',
onRequireCodecovLibStub
);
requireInTheMiddleSingleton.register('test-non-core-module', onRequireCpxStub);
requireInTheMiddleSingleton.register(
'test-non-core-module',
onRequireCpxStub
);
requireInTheMiddleSingleton.register(
'test-non-core-module/lib/copy-sync.js',
onRequireCpxLibStub
Expand Down Expand Up @@ -120,8 +123,12 @@ describe('RequireInTheMiddleSingleton', () => {

describe('non-core module', () => {
describe('AND module name matches', () => {
const baseDir = path.normalize(path.dirname(require.resolve('codecov')));
const modulePath = path.normalize(path.join('codecov', 'lib', 'codecov.js'));
const baseDir = path.normalize(
path.dirname(require.resolve('codecov'))
);
const modulePath = path.normalize(
path.join('codecov', 'lib', 'codecov.js')
);
it('should call `onRequire`', () => {
const exports = require('codecov');
assert.deepStrictEqual(exports.__ritmOnRequires, ['codecov']);
Expand Down Expand Up @@ -149,11 +156,15 @@ describe('RequireInTheMiddleSingleton', () => {

describe('non-core module with sub-path', () => {
describe('AND module name matches', () => {
const baseDir = path.normalize(path.resolve(
path.dirname(require.resolve('test-non-core-module')),
'..'
));
const modulePath = path.normalize(path.join('test-non-core-module', 'lib', 'copy-sync.js'));
const baseDir = path.normalize(
path.resolve(
path.dirname(require.resolve('test-non-core-module')),
'..'
)
);
const modulePath = path.normalize(
path.join('test-non-core-module', 'lib', 'copy-sync.js')
);
it('should call `onRequire`', () => {
const exports = require('test-non-core-module/lib/copy-sync');
assert.deepStrictEqual(exports.__ritmOnRequires, [
Expand All @@ -162,7 +173,12 @@ describe('RequireInTheMiddleSingleton', () => {
]);
sinon.assert.calledWithMatch(
onRequireCpxStub,
{ __ritmOnRequires: ['test-non-core-module', 'test-non-core-module-lib'] },
{
__ritmOnRequires: [
'test-non-core-module',
'test-non-core-module-lib',
],
},
modulePath,
baseDir
);
Expand All @@ -179,7 +195,6 @@ describe('RequireInTheMiddleSingleton', () => {
baseDir
);
}).timeout(30000);

});
});
});
Expand Down

0 comments on commit 78299e2

Please sign in to comment.