Skip to content

Commit

Permalink
chore: attempt to fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
joelmukuthu committed Sep 15, 2023
1 parent b4770c1 commit 31c2ada
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions test/unexpected-knex.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ const unexpectedRequire = require('unexpected-require');
const unexpectedKnex = require('../lib/unexpected-knex');
const dontIndent = require('dedent-js');
const assertErrorOuput = process.env.ASSERT_ERROR_OUTPUT !== 'false';
const packageJson = require('fs')
.readFileSync(require('path').resolve(__dirname, '../package.json'))
.toString();

// This file is `require`d here so that it's cached by Node.js before we go
// ahead and mock out `require`, since knex's migrator require's it while doing
Expand Down Expand Up @@ -71,13 +74,17 @@ describe('unexpected-knex', function () {
// matters is the require() context
context[filename] = '';
return context;
}, {}),
}, {
'../package.json': packageJson,
}),
};
const requireContext = filenames.reduce((context, filename) => {
const absolutePath = path.resolve(migrationsDirectory, filename);
context[absolutePath] = migrations[filename];
return context;
}, {});
}, {
// '../package.json': packageJson,
});
return expect.apply(expect, [
subject,
'with fs mocked out',
Expand Down

0 comments on commit 31c2ada

Please sign in to comment.