Split testing into unit and functional tests.
* Split the `test` nimble task into `unittest` and `functest`, with corresponding test directories and test runners. * Added documentation in README regarding building and testing StrawBoss. * Created a small, simple test project for use in the functional tests. * Added a `keepEnv` template in the server unit test code to make it easy to preserve the working environment for a single unit test to invistigate failures manually.
This commit is contained in:
@ -74,8 +74,17 @@ proc findProject*(cfg: StrawBossConfig, projectName: string): ProjectDef =
|
||||
raise newException(KeyError, "multiple projects named " & projectName)
|
||||
else: result = candidates[0]
|
||||
|
||||
# internal utils
|
||||
proc setProject*(cfg: var StrawBossConfig, projectName: string, newDef: ProjectDef): void =
|
||||
var found = false
|
||||
for idx in 0..<cfg.projects.len:
|
||||
if cfg.projects[idx].name == projectName:
|
||||
cfg.projects[idx] = newDef
|
||||
found = true
|
||||
break
|
||||
|
||||
if not found: cfg.projects.add(newDef)
|
||||
|
||||
# internal utils
|
||||
let nullNode = newJNull()
|
||||
proc getIfExists(n: JsonNode, key: string): JsonNode =
|
||||
# convenience method to get a key from a JObject or return null
|
||||
|
Reference in New Issue
Block a user