Skip to content

Commit

Permalink
fix: set scheme for seed tests in ci
Browse files Browse the repository at this point in the history
  • Loading branch information
ZavenArra committed Feb 18, 2021
1 parent 4c927d2 commit fc80a05
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
10 changes: 8 additions & 2 deletions __tests__/seed.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ describe("Seed data into DB", () => {
before(async () => {
await seed.clear();
await seed.seed();
if(process.env.DATABASE_SCHEMA){
knexConfig.searchPath = [process.env.DATABASE_SCHEMA]
} else {
knexConfig.searchPath = ['public']
}

});

it("Should have api key", async () => {
Expand Down Expand Up @@ -42,7 +48,7 @@ describe("Seed data into DB", () => {
});

it("walletC exists", async () => {
const r = await knex.table("wallets.wallet").select().where("name", seed.walletC.name);
const r = await knex.table("wallet").select().where("name", seed.walletC.name);
expect(r).lengthOf(1);
});

Expand All @@ -57,7 +63,7 @@ describe("Seed data into DB", () => {
});

it("TokenB", async () => {
const r = await knex.table("wallets.token").select()
const r = await knex.table("token").select()
.where("id", seed.tokenB.id);
expect(r).lengthOf(1);
console.log(r)
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
"test-repository": "NODE_ENV=test DOTENV_CONFIG_PATH=.env.test mocha -r dotenv/config --exit --require co-mocha ./server/repositories/**/*.spec.js",
"server-test": "DEBUG=loopback:*,express:* NODE_LOG_LEVEL=debug nodemon server/serverTest.js",
"server": "nodemon server/server.js",
"test-seedDB": "NODE_ENV=test DOTENV_CONFIG_PATH=.env.test mocha -r dotenv/config --timeout 10000 --require co-mocha './__tests__/seed.spec.js'",
"test-seed": "NODE_ENV=test DOTENV_CONFIG_PATH=.env.test mocha -r dotenv/config --timeout 10000 --require co-mocha './__tests__/seed.spec.js'",
"test-seed-ci": "NODE_ENV=test DOTENV_CONFIG_PATH=.env.ci mocha -r dotenv/config --timeout 10000 --require co-mocha './__tests__/seed.spec.js'",
"test-integration": "NODE_ENV=test DOTENV_CONFIG_PATH=.env.test mocha -r dotenv/config --exit --timeout 20000 --require co-mocha './__tests__/*.spec.js'",
"test-integration-ci": "NODE_ENV=test DOTENV_CONFIG_PATH=.env.ci mocha -r dotenv/config --exit --timeout 20000 --require co-mocha './__tests__/*.spec.js'",
"test-watch": "NODE_ENV=test NODE_LOG_LEVEL=info mocha -r dotenv/config dotenv_config_path=.env.test --timeout 10000 --require co-mocha -w -b --ignore './server/repositories/**/*.spec.js' './server/setup.js' './server/**/*.spec.js' './__tests__/seed.spec.js' './__tests__/supertest.js'",
Expand Down

0 comments on commit fc80a05

Please sign in to comment.