hackerspace-bootstrap / strichliste

DEPRECATED - strichliste is a tool to replace a tally sheet inside a hackerspace, this module is the api for the strichliste
MIT License
17 stars 12 forks source link

Test fails: Integration creation should not fail when invalid json is posted to the api: #274

Closed NicoHood closed 6 years ago

NicoHood commented 6 years ago
[arch@talloniv strichliste]$ git clone git@github.com:hackerspace-bootstrap/strichliste.git
Cloning into 'strichliste'...
remote: Counting objects: 2499, done.
remote: Total 2499 (delta 0), reused 0 (delta 0), pack-reused 2499
Receiving objects: 100% (2499/2499), 686.39 KiB | 996.00 KiB/s, done.
Resolving deltas: 100% (1603/1603), done.
[arch@talloniv strichliste]$ cd strichliste/
[arch@talloniv strichliste]$ npm i

> sqlite3@3.1.13 install /home/arch/hackallthethings/strichliste/strichliste/node_modules/sqlite3
> node-pre-gyp install --fallback-to-build

[sqlite3] Success: "/home/arch/hackallthethings/strichliste/strichliste/node_modules/sqlite3/lib/binding/node-v59-linux-x64/node_sqlite3.node" is installed via remote
added 362 packages in 4.867s
[arch@talloniv strichliste]$ make test
npm prune
up to date in 1.303s
rm -f testdata.sqlite
make[1]: Entering directory '/home/arch/hackallthethings/strichliste/strichliste'
NODE_ENV=test ./node_modules/.bin/_mocha --timeout 10000 --reporter dot tests/unit/Mqtt.tests.js tests/unit/Parameters.tests.js tests/unit/Result.tests.js tests/unit/Route.Metrics.get.tests.js tests/unit/Route.Settings.get.tests.js tests/unit/Route.User.get.tests.js tests/unit/Route.User.post.tests.js tests/unit/Route.UserId.get.tests.js tests/unit/Route.UserIdTransaction.get.tests.js tests/unit/Route.UserIdTransaction.post.tests.js tests/unit/Route.UserIdTransactionId.get.tests.js tests/unit/Routing.tests.js

  ․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․․
  ․․․․․․․․․․․․․․․․․․․․․․

  154 passing (73ms)

make[1]: Leaving directory '/home/arch/hackallthethings/strichliste/strichliste'
make[1]: Entering directory '/home/arch/hackallthethings/strichliste/strichliste'
NODE_ENV=test ./node_modules/.bin/_mocha --timeout 10000 --reporter dot tests/integration/creation.tests.js tests/integration/lists.tests.js

current version: 0
running version 1 migration
running version 2 migration

  ․․․․․․․․․․․․․․!current version: 2
no version updates necessary!
․․․․․․․․․․․

  25 passing (793ms)
  1 failing

  1) Integration creation should not fail when invalid json is posted to the api:
     Error: expected '{"message":"Unexpected token }"}' response body, got '{"message":"Unexpected token } in JSON at position 9"}'
      at error (node_modules/supertest/lib/test.js:283:13)
      at Test._assertBody (node_modules/supertest/lib/test.js:199:16)
      at Test._assertFunction (node_modules/supertest/lib/test.js:265:11)
      at Test.assert (node_modules/supertest/lib/test.js:153:18)
      at Server.assert (node_modules/supertest/lib/test.js:131:12)
      at emitCloseNT (net.js:1676:8)
      at process._tickCallback (internal/process/next_tick.js:152:19)

make[1]: *** [Makefile:11: run-integration-tests] Error 1
make[1]: Leaving directory '/home/arch/hackallthethings/strichliste/strichliste'
make: *** [Makefile:20: test] Error 2

Using master with version 1.5.0 (+1 commit)

seriousManual commented 6 years ago

fixed, thx