Skip to content

Commit

Permalink
rename process to manager.process to restore access to node process
Browse files Browse the repository at this point in the history
  • Loading branch information
TwitchBronBron committed Feb 20, 2021
1 parent 6a87c8a commit 9b5c4be
Showing 1 changed file with 30 additions and 30 deletions.
60 changes: 30 additions & 30 deletions src/prefixer/ModuleManager.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ describe('ModuleManager', () => {
noprefixNpmAliases = [];
});

async function process() {
async function managerProcess() {
manager.hostDependencies = await util.getModuleDependencies(hostDir);
manager.noprefixNpmAliases = noprefixNpmAliases;
await manager.process();
Expand All @@ -45,7 +45,7 @@ describe('ModuleManager', () => {
await createDependencies([{
name: 'promise'
}]);
await process();
await managerProcess();
expect(manager.getReducedDependencies()).to.eql([{
npmModuleName: 'promise',
dominantVersion: '1',
Expand All @@ -62,7 +62,7 @@ describe('ModuleManager', () => {
name: 'promise'
}]
}]);
await process();
await managerProcess();
expect(manager.getReducedDependencies().filter(x => x.npmModuleName === 'promise')).to.eql([{
npmModuleName: 'promise',
dominantVersion: '1',
Expand All @@ -83,7 +83,7 @@ describe('ModuleManager', () => {
}]
}]
}]);
await process();
await managerProcess();
expect(manager.getReducedDependencies().filter(x => x.npmModuleName !== 'logger').sort((a, b) => a.dominantVersion.localeCompare(b.dominantVersion))).to.eql([{
npmModuleName: 'promise',
dominantVersion: '1',
Expand All @@ -106,7 +106,7 @@ describe('ModuleManager', () => {
name: 'promise',
version: '2.0.0'
}]);
await process();
await managerProcess();
expect(manager.getReducedDependencies().sort((a, b) => a.dominantVersion.localeCompare(b.dominantVersion))).to.eql([{
npmModuleName: 'promise',
dominantVersion: '1',
Expand Down Expand Up @@ -167,7 +167,7 @@ describe('ModuleManager', () => {
name: 'promise',
version: '2.0.0'
}]);
await process();
await managerProcess();

await manager.reduceModulesAndCreatePrefixMaps();
expect(manager.modules.map(x => [x.npmModuleName, x.version])).to.eql([
Expand All @@ -194,7 +194,7 @@ describe('ModuleManager', () => {
name: 'promise',
version: '2.0.0'
}]);
await process();
await managerProcess();
await manager.reduceModulesAndCreatePrefixMaps();
expect(manager.modules.map(x => [x.npmModuleName, x.version])).to.eql([
['promise', '1.2.0'],
Expand All @@ -218,7 +218,7 @@ describe('ModuleManager', () => {
print ROPM_PREFIX + "ROPM_PREFIX"
end sub
`);
await process();
await managerProcess();

fsEqual(`${hostDir}/source/roku_modules/logger/lib.brs`, `
sub logger_log(ROPM_PREFIX = "")
Expand Down Expand Up @@ -247,7 +247,7 @@ describe('ModuleManager', () => {
return logger_writeToLog(message)
end sub
`);
await process();
await managerProcess();

fsEqual(`${hostDir}/source/roku_modules/logger/main.brs`, `
sub logger_WriteToLog(message)
Expand All @@ -274,7 +274,7 @@ describe('ModuleManager', () => {
print message
end sub
`);
await process();
await managerProcess();

fsEqual(`${hostDir}/source/roku_modules/logger/main.brs`, `
sub main()
Expand Down Expand Up @@ -316,7 +316,7 @@ describe('ModuleManager', () => {
sub NonSpecialFunction()
end sub
`);
await process();
await managerProcess();

fsEqual(`${hostDir}/source/roku_modules/logger/main.brs`, `
sub runuserinterface()
Expand Down Expand Up @@ -354,7 +354,7 @@ describe('ModuleManager', () => {
sub __Sub2()
end sub
`);
await process();
await managerProcess();

fsEqual(`${hostDir}/source/roku_modules/logger/main.brs`, `
sub main()
Expand Down Expand Up @@ -394,7 +394,7 @@ describe('ModuleManager', () => {
comp.CreateChild("Component2")
end sub
`);
await process();
await managerProcess();

fsEqual(`${hostDir}/components/roku_modules/logger/Component1.xml`, `
<?xml version="1.0" encoding="utf-8" ?>
Expand Down Expand Up @@ -436,7 +436,7 @@ describe('ModuleManager', () => {
end sub
`);

await process();
await managerProcess();

fsEqual(`${hostDir}/source/roku_modules/logger/main.brs`, `
sub logger_PrintValue(value)
Expand Down Expand Up @@ -471,7 +471,7 @@ describe('ModuleManager', () => {
}
}]);

await process();
await managerProcess();
fsEqual(`${hostDir}/source/roku_modules/logger/lib.brs`, `
sub logger_getPerson()
person = {
Expand Down Expand Up @@ -508,7 +508,7 @@ describe('ModuleManager', () => {
`
}
}]);
await process();
await managerProcess();
fsEqual(`${hostDir}/source/roku_modules/logger/lib.brs`, `
sub logger_writeToLog(message)
logFunc = logger_logWarning
Expand Down Expand Up @@ -537,7 +537,7 @@ describe('ModuleManager', () => {
}
}]);

await process();
await managerProcess();
fsEqual(`${hostDir}/source/roku_modules/logger/lib.brs`, `
sub logger_logWarning(message)
logger_log(message, "warning")
Expand Down Expand Up @@ -565,7 +565,7 @@ describe('ModuleManager', () => {
'source/lib.brs': fileContents
}
}]);
await process();
await managerProcess();
fsEqual(`${hostDir}/source/roku_modules/logger/lib.brs`, trim`
sub init()
${expectedLine}
Expand Down Expand Up @@ -645,7 +645,7 @@ describe('ModuleManager', () => {
}
}]);

await process();
await managerProcess();
fsEqual(`${hostDir}/source/roku_modules/logger/lib.brs`, `
sub logger_logWarning(message)
doSomething = sub()
Expand Down Expand Up @@ -683,7 +683,7 @@ describe('ModuleManager', () => {
</component>
`);

await process();
await managerProcess();

fsEqual(`${hostDir}/components/roku_modules/logger/Component1.xml`, `
<?xml version="1.0" encoding="utf-8" ?>
Expand All @@ -707,7 +707,7 @@ describe('ModuleManager', () => {
// the jsonlib package forgot to exclude its roku_modules folder
file(`${promise.packageRootDir}/source/roku_modules/jsonlib/json.brs`, ``);

await process();
await managerProcess();

//ropm should have IGNORED the roku_modules folder from the promise package
expect(fsExtra.pathExistsSync(`${hostDir}/source/roku_modules/promise_v1/roku_modules/jsonlib/json.brs`)).to.be.false;
Expand All @@ -731,7 +731,7 @@ describe('ModuleManager', () => {
</component>
`);

await process();
await managerProcess();

fsEqual(`${hostDir}/components/roku_modules/logger/Component1.xml`, `
<?xml version="1.0" encoding="utf-8" ?>
Expand Down Expand Up @@ -763,7 +763,7 @@ describe('ModuleManager', () => {
</component>
`);

await process();
await managerProcess();

fsEqual(`${hostDir}/components/roku_modules/logger/Component1.xml`, `
<?xml version="1.0" encoding="utf-8" ?>
Expand Down Expand Up @@ -793,7 +793,7 @@ describe('ModuleManager', () => {
end sub
`);

await process();
await managerProcess();

fsEqual(`${hostDir}/source/roku_modules/logger/common.brs`, `
sub logger_GetImagePath(imageName)
Expand Down Expand Up @@ -865,7 +865,7 @@ describe('ModuleManager', () => {
}]
});

await process();
await managerProcess();

//the logger module should use the "l" prefix
fsEqual(`${hostDir}/source/roku_modules/l/loggerlib.brs`, `
Expand Down Expand Up @@ -915,7 +915,7 @@ describe('ModuleManager', () => {
}]
});

await process();
await managerProcess();

//the logger module should have no prefixes applied to its functions or components
fsEqual(`${hostDir}/source/roku_modules/logger/loggerlib.brs`, `
Expand Down Expand Up @@ -975,7 +975,7 @@ describe('ModuleManager', () => {
}]
});

await process();
await managerProcess();

//the logger module should have no prefixes applied to its functions or components
fsEqual(`${hostDir}/source/roku_modules/logger/loggerlib.brs`, `
Expand Down Expand Up @@ -1087,7 +1087,7 @@ describe('ModuleManager', () => {
}]
}]
});
await process();
await managerProcess();
expect(manager.modules.map(x => x.npmModuleName)).to.eql(['smartlist']);
});

Expand All @@ -1113,7 +1113,7 @@ describe('ModuleManager', () => {
}]
});

await process();
await managerProcess();

fsEqual(`${hostDir}/components/roku_modules/logger/loggercomp.xml`, trim`
<?xml version="1.0" encoding="utf-8" ?>
Expand Down Expand Up @@ -1417,7 +1417,7 @@ describe('ModuleManager', () => {
}]
});

await process();
await managerProcess();

fsEqual(`${hostDir}/source/roku_modules/logger/lib.d.bs`, `
namespace logger
Expand Down

0 comments on commit 9b5c4be

Please sign in to comment.