-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e0fb48c
commit 6bc2e5f
Showing
3 changed files
with
66 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,25 @@ | ||
name: Assign Issues | ||
name: Tests | ||
|
||
on: | ||
issues: | ||
types: [opened] | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
|
||
jobs: | ||
auto-assign: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
issues: write | ||
steps: | ||
- name: 'Auto-assign issue' | ||
uses: pozil/auto-assign-issue@v2 | ||
with: | ||
assignees: Glowstudent777 | ||
allowSelfAssign: false | ||
tests: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v2 | ||
with: | ||
submodules: true | ||
|
||
- name: Set up Node | ||
uses: actions/setup-node@v3 | ||
|
||
- name: Install dependencies | ||
run: npm install | ||
|
||
- run: npm run test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,39 @@ | ||
import { getVerse } from "../src/api/v1/functions/verse"; | ||
import { expect, it, describe } from 'vitest'; | ||
import { getVerse } from "../src/api/v1/core/functions/verse"; | ||
import { expect, it, describe } from "vitest"; | ||
|
||
describe("getVerse", () => { | ||
it("John 3:16", async () => { | ||
const verse = await getVerse("John", "3", "16", "NIV"); | ||
|
||
expect(verse?.citation).toBe("John 3:16"); | ||
expect(verse?.passage).toBe("For God so loved the world that he gave his one and only Son, that whoever believes in him shall not perish but have eternal life."); | ||
}); | ||
|
||
it("Genesis 1:1", async () => { | ||
const verse = await getVerse("GEN", "1", "1", "KJV"); | ||
|
||
expect(verse?.citation).toBe("Genesis 1:1"); | ||
expect(verse?.passage).toBe("In the beginning God created the heaven and the earth."); | ||
}); | ||
|
||
it("Invalid verse", async () => { | ||
const verse = await getVerse("JHN", "3", "54", "NIV"); | ||
|
||
expect(verse?.code).toBe(400); | ||
expect(verse?.message).toBe("Verse not found"); | ||
}); | ||
|
||
it("Invalid book", async () => { | ||
const book = "Coffee"; | ||
const verse = await getVerse(book, "5", "11", "NIV"); | ||
|
||
expect(verse?.code).toBe(400); | ||
expect(verse?.message).toBe(`Could not find book '${book}' by name or alias.`); | ||
}); | ||
it("John 3:16", async () => { | ||
const verse = await getVerse("John", "3", "16", "NIV"); | ||
|
||
expect(verse?.citation).toBe("John 3:16"); | ||
expect(verse?.passage).toBe( | ||
"For God so loved the world that he gave his one and only Son, that whoever believes in him shall not perish but have eternal life." | ||
); | ||
}); | ||
|
||
it("Genesis 1:1", async () => { | ||
const verse = await getVerse("GEN", "1", "1", "KJV"); | ||
|
||
expect(verse?.citation).toBe("Genesis 1:1"); | ||
expect(verse?.passage).toBe( | ||
"In the beginning God created the heaven and the earth." | ||
); | ||
}); | ||
|
||
it("Invalid verse", async () => { | ||
const verse = await getVerse("JHN", "3", "54", "NIV"); | ||
|
||
expect(verse?.code).toBe(400); | ||
expect(verse?.message).toBe("Verse not found"); | ||
}); | ||
|
||
it("Invalid book", async () => { | ||
const book = "Coffee"; | ||
const verse = await getVerse(book, "5", "11", "NIV"); | ||
|
||
expect(verse?.code).toBe(400); | ||
expect(verse?.message).toBe( | ||
`Could not find book '${book}' by name or alias.` | ||
); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
import { getVotd } from "../src/api/v1/functions/votd"; | ||
import { expect, it, describe } from 'vitest'; | ||
import { getVotd } from "../src/api/v1/core/functions/votd"; | ||
import { expect, it, describe } from "vitest"; | ||
|
||
describe("getVotd", () => { | ||
it("VOTD", async () => { | ||
const verse = await getVotd("en"); | ||
const verse2 = await getVotd("coffee"); | ||
it("VOTD", async () => { | ||
const verse = await getVotd("en"); | ||
const verse2 = await getVotd("coffee"); | ||
|
||
expect(verse?.citation).toBeDefined(); | ||
expect(verse?.passage).toBeDefined(); | ||
expect(verse?.citation).toBeDefined(); | ||
expect(verse?.passage).toBeDefined(); | ||
|
||
expect(verse2).toBeUndefined(); | ||
}); | ||
expect(verse2).toBeUndefined(); | ||
}); | ||
}); |