message: Turn checkDictKeys into an assertion
diff: @@ -27,8 +27,11 @@ type CmdType = {
  label?: string
  }
  -function checkDictKeys(keys: string[], expectedKeys: string[], optKeys: string[] = []): boolean {
  - return keys.every(k => expectedKeys.includes(k) || optKeys.includes(k)) && expectedKeys.every(k => keys.includes(k))
  +function assertDictKeyNames(keys: string[], expectedKeys: string[], optKeys: string[] = [], message: string): void {
  + assert.ok(
  + keys.every(k => expectedKeys.includes(k) || optKeys.includes(k)) && expectedKeys.every(k => keys.includes(k)),
  + message
  + )
  }
  suite('unit test suite', () => {
  @@ -47,12 +50,10 @@ suite('unit test suite', () => {
  const envs = JSON.parse(fs.readFileSync(file, {encoding: 'utf8'})) as {[key: string]: EnvType}
  assert.ok(Object.keys(envs).length > 0)
  Object.keys(envs).forEach(name => {
  - assert.ok(
  - checkDictKeys(
  + assertDictKeyNames(
  Object.keys(envs[name]),
  ['name'],
  - ['snippet', 'detail']
  - ),
  + ['snippet', 'detail'],
  file + ': ' + JSON.stringify(envs[name])
  )
  })
  @@ -66,11 +67,10 @@ suite('unit test suite', () => {
  const envs = JSON.parse(fs.readFileSync(path.join(extensionRoot, file), {encoding: 'utf8'})) as {[key: string]: EnvType}
  assert.ok(Object.keys(envs).length > 0)
  Object.keys(envs).forEach(name => {
  - assert.ok(
  - checkDictKeys(
  + assertDictKeyNames(
  Object.keys(envs[name]),
  - ['name', 'snippet', 'detail', 'package']
  - ),
  + ['name', 'snippet', 'detail', 'package'],
  + [],
  file + ': ' + JSON.stringify(envs[name])
  )
  })
  @@ -84,12 +84,10 @@ suite('unit test suite', () => {
  const cmds = JSON.parse(fs.readFileSync(file, {encoding: 'utf8'})) as {[key: string]: CmdType}
  assert.ok(Object.keys(cmds).length > 0)
  Object.keys(cmds).forEach(name => {
  - assert.ok(
  - checkDictKeys(
  + assertDictKeyNames(
  Object.keys(cmds[name]),
  ['command'],
  - ['snippet', 'documentation', 'detail', 'postAction', 'label']
  - ),
  + ['snippet', 'documentation', 'detail', 'postAction', 'label'],
  file + ': ' + JSON.stringify(cmds[name])
  )
  })
  @@ -103,12 +101,10 @@ suite('unit test suite', () => {
  const cmds = JSON.parse(fs.readFileSync(path.join(extensionRoot, file), {encoding: 'utf8'})) as {[key: string]: CmdType}
  assert.ok(Object.keys(cmds).length > 0)
  Object.keys(cmds).forEach(name => {
  - assert.ok(
  - checkDictKeys(
  + assertDictKeyNames(
  Object.keys(cmds[name]),
  ['command', 'snippet'],
  - ['documentation', 'detail', 'postAction', 'package', 'label']
  - ),
  + ['documentation', 'detail', 'postAction', 'package', 'label'],
  file + ': ' + JSON.stringify(cmds[name])
  )
  })
  