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 17, 2023
1 parent b4770c1 commit 8ff7f17
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion test/unexpected-knex.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,17 @@ 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 packageJsonPath = path.resolve(__dirname, '../package.json')
// const packageJson = require('../package.json')
const packageJson = require('fs')
.readFileSync(packageJsonPath)
.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
// its job.
require('knex/lib/util/import-file.js');
// require('../package.json');

describe('unexpected-knex', function () {
const host = process.env.PGHOST || 'localhost';
Expand Down Expand Up @@ -71,7 +77,9 @@ describe('unexpected-knex', function () {
// matters is the require() context
context[filename] = '';
return context;
}, {}),
}, {
[packageJsonPath]: packageJson
}),
};
const requireContext = filenames.reduce((context, filename) => {
const absolutePath = path.resolve(migrationsDirectory, filename);
Expand Down

0 comments on commit 8ff7f17

Please sign in to comment.