Skip to content

Commit 8cafe55

Browse files
Added tests and changed structure
1 parent 7999fbb commit 8cafe55

File tree

12 files changed

+3887
-1277
lines changed

12 files changed

+3887
-1277
lines changed

.github/workflows/tests.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
tests:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name : Checkout repo
15+
uses: actions/checkout@v2
16+
17+
- name: Set up Node
18+
uses: actions/setup-node@v3
19+
20+
- name: Install dependencies
21+
run: npm install
22+
23+
- run: npm run test

jest.config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module.exports = {
2+
preset: "ts-jest",
3+
testEnvironment: "node",
4+
testRegex: '/tests/.*\\.(test|spec)?\\.(ts|tsx)$',
5+
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node']
6+
};

package.json

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
{
22
"name": "@glowstudent/youversion",
3-
"version": "1.3.0",
3+
"version": "1.3.1",
44
"description": "A simple module to get the Verse of the Day and any verse you would like.",
55
"main": "./dist/index.js",
66
"types": "./dist/index.d.ts",
7-
"files": ["dist"],
7+
"files": [
8+
"dist"
9+
],
810
"funding": "https://ko-fi.com/glowstudent",
911
"dependencies": {
1012
"axios": "1.1.3",
@@ -15,11 +17,14 @@
1517
"@babel/cli": "^7.19.3",
1618
"@babel/core": "^7.20.2",
1719
"@babel/preset-env": "^7.20.2",
20+
"@types/jest": "^29.5.12",
1821
"@types/node": "^18.11.9",
22+
"jest": "^29.7.0",
23+
"ts-jest": "^29.1.2",
1924
"typescript": "^4.9.3"
2025
},
2126
"scripts": {
22-
"test": "echo \"Error: no test specified\" && exit 1",
27+
"test": "jest",
2328
"build": "npm run babel && npm run tsc && npm run pack",
2429
"babel": "babel src -d dist --copy-files",
2530
"tsc": "npx tsc",
@@ -36,4 +41,4 @@
3641
"url": "https://github.com/Glowstudent777/YouVersion-API-NPM/issues"
3742
},
3843
"homepage": "https://github.com/Glowstudent777/YouVersion-API-NPM#readme"
39-
}
44+
}

0 commit comments

Comments
 (0)