MCPcopy Create free account
hub / github.com/FSGModding/FSG_Mod_Assistant / testGood

Function testGood

test/tests/csvcheck.js:29–55  ·  view source on GitHub ↗
(test)

Source from the content-addressed store, hash-verified

27}
28
29const testGood = (test) => {
30 const fullPath = path.join(__dirname, 'savegame', 'testcollect.csv')
31
32 return new csvFileChecker(fullPath, false).getInfo().then((results) => {
33 if ( results.mapMod !== null ) {
34 test.step('Got expected map name')
35 } else {
36 test.error('Got unexpected map name')
37 }
38
39 if ( Object.keys(results.farms).length === 2 ) {
40 test.step('Got expected number of farms (2 [default])')
41 } else {
42 test.error('Got unexpected number of farms')
43 }
44
45 if ( Object.keys(results.mods).length === 166 ) {
46 test.step('Got expected number of mods (166)')
47 } else {
48 test.error('Got unexpected number of mods')
49 }
50 }).catch((err) => {
51 test.error(`Unexpected Error :: ${err}`)
52 }).finally(() => {
53 test.end()
54 })
55}

Callers 1

csvcheck.jsFile · 0.85

Calls 5

stepMethod · 0.80
keysMethod · 0.80
endMethod · 0.80
getInfoMethod · 0.45
errorMethod · 0.45

Tested by

no test coverage detected