Skip to content

Commit

Permalink
chore: move test DB and SQL file to test folder
Browse files Browse the repository at this point in the history
  • Loading branch information
mateusabelli committed Dec 3, 2023
1 parent 18e6c64 commit f755aa5
Show file tree
Hide file tree
Showing 10 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ async function getPosts() {

### Expected data from `response`

> Using the [test.db](./test.db) database file.
> Using the [test.db](test/test.db) database file.
```bash
{
Expand Down
4 changes: 2 additions & 2 deletions test/jest.setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import sqlite3 from "sqlite3";
import fs from "fs";

beforeAll(async () => {
const dbPath = "test.db";
const dbPath = "test/test.db";
try {
// Delete the database if it exists (DB must be disconnected first)
if (fs.existsSync(dbPath)) {
Expand All @@ -16,7 +16,7 @@ beforeAll(async () => {
});

// Read the sql file
const sql = fs.readFileSync("./test.sql").toString();
const sql = fs.readFileSync("./test/test.sql").toString();
const sqlArray = sql.split(";")

// Create the tables
Expand Down
2 changes: 1 addition & 1 deletion test/methods/create.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import dataProvider from "../../src";

describe("create", () => {
const apiUrl = "./test.db"
const apiUrl = "./test/test.db"

it("correct response", async () => {
const response = await dataProvider(
Expand Down
2 changes: 1 addition & 1 deletion test/methods/delete.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import dataProvider from "../../src";

describe("deleteOne", () => {
const apiUrl = "./test.db"
const apiUrl = "./test/test.db"

it("correct response", async () => {
const response = await dataProvider(apiUrl)
Expand Down
2 changes: 1 addition & 1 deletion test/methods/getList.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import dataProvider from "../../src";

describe("getList", () => {
const apiUrl = "./test.db"
const apiUrl = "./test/test.db"

it("correct response", async () => {
const response = await dataProvider(apiUrl)
Expand Down
2 changes: 1 addition & 1 deletion test/methods/getMany.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import dataProvider from "../../src";

describe("getMany", () => {
const apiUrl = "./test.db";
const apiUrl = "./test/test.db";

it("correct response", async () => {
const response = await dataProvider(apiUrl)
Expand Down
2 changes: 1 addition & 1 deletion test/methods/getOne.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import dataProvider from "../../src/"

describe("getOne", () => {
const apiUrl = "./test.db";
const apiUrl = "./test/test.db";

it("correct response", async () => {
const response = await dataProvider(apiUrl)
Expand Down
2 changes: 1 addition & 1 deletion test/methods/update.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import dataProvider from "../../src";

describe("update", () => {
const apiUrl = "./test.db"
const apiUrl = "./test/test.db"

it("correct response", async () => {
const response = await dataProvider(apiUrl)
Expand Down
Binary file renamed test.db → test/test.db
Binary file not shown.
File renamed without changes.

0 comments on commit f755aa5

Please sign in to comment.