Refactor to inject multiple properties

This commit is contained in:
Yoann Chaudet
2022-07-19 17:03:44 -07:00
parent ad121920a0
commit 3d2f0e5994
8 changed files with 99 additions and 78 deletions

View File

@@ -130,7 +130,7 @@ const cases = [
property: 'a.b.c',
source: `var config = { a: { b: [], c: "hello"}}; module.exports = config`,
expected: `var config = { a: { b: { c: "value"}, c: "hello"}}; module.exports = config`
},
}
]
describe('config-parser', () => {
@@ -146,10 +146,8 @@ describe('config-parser', () => {
// Update the settings and do the injection
new ConfigParser({
configurationFile: sourceFile,
propertyName: property,
propertyValue: 'value'
}).inject()
configurationFile: sourceFile
}).inject(property, 'value')
// Compare the files
compareFiles(sourceFile, expectedFile)