Fix the tests so they run again
Also make the tests reflect the current reality
This commit is contained in:
parent
f4f4acd8f1
commit
d561598d06
10
Makefile
10
Makefile
|
@ -6,6 +6,9 @@ JEST=$(PWD)/node_modules/jest/bin/jest.js
|
|||
SEQUELIZE=$(PWD)/node_modules/sequelize-cli/lib/sequelize
|
||||
COMPOSE:=./tools/docker-compose
|
||||
|
||||
JEST_ARGS=--runInBand --bail --forceExit --detectOpenHandles
|
||||
|
||||
|
||||
all: build check
|
||||
|
||||
depends: package.json package-lock.json
|
||||
|
@ -15,7 +18,10 @@ build: depends
|
|||
$(TSC)
|
||||
|
||||
check: build depends migrate
|
||||
$(JEST) --bail
|
||||
# Running with docker-compose since our tests require a database to be
|
||||
# present
|
||||
$(COMPOSE) run --rm node \
|
||||
/usr/local/bin/node $(JEST) $(JEST_ARGS)
|
||||
|
||||
clean:
|
||||
$(COMPOSE) down || true
|
||||
|
@ -43,7 +49,7 @@ watch: migrate
|
|||
# Running with docker-compose since our tests require a database to be
|
||||
# present
|
||||
$(COMPOSE) run --rm node \
|
||||
/usr/local/bin/node $(JEST) --watchAll --bail --forceExit
|
||||
/usr/local/bin/node $(JEST) $(JEST_ARGS) --watch
|
||||
|
||||
watch-compile:
|
||||
$(TSC) -w
|
||||
|
|
|
@ -9,7 +9,7 @@ services:
|
|||
- 'POSTGRES_DB=uplink_development'
|
||||
|
||||
node:
|
||||
image: node:10-alpine
|
||||
image: node:10
|
||||
command: '/usr/local/bin/node $PWD/node_modules/.bin/nodemon build'
|
||||
working_dir: $PWD
|
||||
environment:
|
||||
|
|
|
@ -27,12 +27,15 @@ describe('Acceptance tests for /evetns', () => {
|
|||
json: true,
|
||||
resolveWithFullResponse: true,
|
||||
}).then(response =>
|
||||
expect(response.statusCode).toEqual(200)
|
||||
expect(response.statusCode).toEqual(401)
|
||||
).catch(err =>
|
||||
expect(err.statusCode).toEqual(401)
|
||||
);
|
||||
});
|
||||
|
||||
it('POST /events should allow creating a valid event', () => {
|
||||
return request(getUrl('/events'), {
|
||||
method: 'POST',
|
||||
json: true,
|
||||
resolveWithFullResponse: true,
|
||||
body: {
|
||||
|
@ -43,7 +46,7 @@ describe('Acceptance tests for /evetns', () => {
|
|||
correlator: '0xdeadbeef',
|
||||
},
|
||||
}).then(response =>
|
||||
expect(response.statusCode).toEqual(200)
|
||||
expect(response.statusCode).toEqual(201)
|
||||
);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -25,5 +25,5 @@ exec docker run --rm ${TTY_ARGS} --net host \
|
|||
-e LANG=C.UTF-8 \
|
||||
-e LOG_LEVEL=$LOG_LEVEL \
|
||||
$(printenv | grep -i \^node | awk '{ print "-e", $1 }') \
|
||||
node:10-alpine \
|
||||
node:10 \
|
||||
${COMMAND}
|
||||
|
|
Loading…
Reference in New Issue