add npm command to test matching and notification services

This commit is contained in:
Bilal Catic
2019-09-29 19:28:47 +02:00
parent 6d7366f2c2
commit c57d3f8457
2 changed files with 15 additions and 1 deletions

View File

@@ -11,7 +11,8 @@
"setup": "docker build -t marketalerts . && docker run -e POSTGRES_USER=docker -e POSTGRES_PASSWORD=docker -e POSTGRES_DB=marketalerts --name pg_marketalerts -d -p 5432:5432 marketalerts && sleep 4 && npm run migrate",
"docker-start": "docker start pg_marketalerts",
"docker-stop": "docker stop pg_marketalerts",
"crawl": "cd app/crawler && node npmCrawl.js"
"crawl": "cd app/crawler && node npmCrawl.js",
"test-search": "cd test && node searchTest.js"
},
"repository": {
"type": "git",

13
test/searchTest.js Normal file
View File

@@ -0,0 +1,13 @@
const { getRealEstateById } = require("../app/helpers/db/realEstate");
const {
findSearchRequestsForRealEstate
} = require("../app/helpers/db/searchRequest");
(async () => {
const realEstate = await getRealEstateById(53069);
const searchRequestsForRealEstate = await findSearchRequestsForRealEstate(
realEstate
);
console.log(searchRequestsForRealEstate);
})();