Skip to content

Commit

Permalink
Revert "update filtersRegistry, generator, integration.test"
Browse files Browse the repository at this point in the history
This reverts commit 55f9ae7.
  • Loading branch information
lmgyuan committed May 24, 2024
1 parent 49c8952 commit eebca77
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
4 changes: 2 additions & 2 deletions lib/filtersRegistry.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const { isAsyncFunction } = require('./utils');
*/
module.exports.registerFilters = async (nunjucks, templateConfig, templateDir, filtersDir) => {
await registerLocalFilters(nunjucks, templateDir, filtersDir);
await registerConfigFilters(nunjucks, templateDir, templateConfig);
registerConfigFilters(nunjucks, templateDir, templateConfig);
};

/**
Expand All @@ -22,7 +22,7 @@ module.exports.registerFilters = async (nunjucks, templateConfig, templateDir, f
* @param {String} templateDir Directory where template is located.
* @param {String} filtersDir Directory where local filters are located.
*/
async function registerLocalFilters(nunjucks, templateDir, filtersDir) {
function registerLocalFilters(nunjucks, templateDir, filtersDir) {
return new Promise((resolve, reject) => {
const localFilters = path.resolve(templateDir, filtersDir);

Expand Down
1 change: 0 additions & 1 deletion lib/generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ const log = require('loglevel');
const Arborist = require('@npmcli/arborist');
const Config = require('@npmcli/config');
const requireg = require('requireg');
console.log("requireg.resolve('npm'): ", requireg.resolve('npm'));
const npmPath = requireg.resolve('npm').replace('index.js','');

const { isAsyncAPIDocument } = require('@asyncapi/parser/cjs/document');
Expand Down
10 changes: 5 additions & 5 deletions test/integration.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,12 @@ describe('Integration testing generateFromFile() to make sure the result of the
// Check if the log debug message was printed
await expect(log.debug).toHaveBeenCalledWith(`noOverwriteGlobs matched`);
await expect(log.debug).toHaveBeenCalledWith(`Skipping overwrite for: ${testFilePath}`);
// await console.log('All console.log calls:');
console.log('All console.log calls:');

// // Print all console.log calls
// await log.mock.calls.forEach((call, index) => {
// console.log(`${index + 1}:`, call);
// });
// Print all console.log calls
await log.mock.calls.forEach((call, index) => {
console.log(`${index + 1}:`, call);
});

log.mockRestore();
});
Expand Down

0 comments on commit eebca77

Please sign in to comment.