Add tests for config-parser

This commit is contained in:
Yoann Chaudet
2022-07-19 16:15:25 -07:00
parent 250c4fb989
commit 931e155079
8 changed files with 206 additions and 128 deletions
+3 -3
View File
@@ -202,9 +202,9 @@ class ConfigParser {
// The last node identified is an object expression, so do the assignment
if (lastNode.type === 'ObjectExpression') {
this.configuration =
this.configuration.slice(0, lastNode.value.range[0]) +
this.configuration.slice(0, lastNode.range[0]) +
`"${this.propertyValue}"` +
this.configuration.slice(lastNode.value.range[1])
this.configuration.slice(lastNode.range[1])
}
// A misc object was found in the configuration file (e.g. an array, a string, a boolean,
@@ -249,7 +249,7 @@ class ConfigParser {
else {
this.configuration =
this.configuration.slice(0, lastNode.range[0]) +
declaration +
'{' + declaration + '}' +
this.configuration.slice(lastNode.range[1])
}
}