Skip to content

Commit

Permalink
chore: setup tests
Browse files Browse the repository at this point in the history
  • Loading branch information
wa0x6e committed Nov 28, 2023
1 parent d640727 commit e354bd8
Show file tree
Hide file tree
Showing 6 changed files with 1,837 additions and 12 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name: Test

on: [push]

jobs:
test:
uses: snapshot-labs/actions/.github/workflows/test.yml@main
secrets: inherit
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ node_modules
dist
build
.env
coverage

# Remove some common IDE working directories
.idea
Expand Down
18 changes: 18 additions & 0 deletions jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/*
* For a detailed explanation regarding each configuration property and type check, visit:
* https://jestjs.io/docs/configuration
*/

export default {
clearMocks: true,
collectCoverage: true,
collectCoverageFrom: ['./src/**'],
coverageDirectory: 'coverage',
coverageProvider: 'v8',
coveragePathIgnorePatterns: ['/node_modules/', '<rootDir>/dist/', '<rootDir>/test/fixtures/'],
preset: 'ts-jest',
testEnvironment: 'jest-environment-node-single-context',
setupFiles: ['dotenv/config'],
moduleFileExtensions: ['js', 'ts'],
verbose: true
};
9 changes: 7 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"typecheck": "tsc --noEmit",
"build": "tsc",
"dev": "nodemon src/index.ts",
"start": "node dist/src/index.js"
"start": "node dist/src/index.js",
"test": "yarn jest"
},
"eslintConfig": {
"extends": "@snapshot-labs"
Expand Down Expand Up @@ -43,9 +44,13 @@
"@snapshot-labs/eslint-config": "^0.1.0-beta.15",
"@snapshot-labs/prettier-config": "^0.1.0-beta.11",
"@types/express": "^4.17.11",
"@types/jest": "^29.5.10",
"@types/node": "^18.0.0",
"eslint": "^8.47.0",
"prettier": "^3.0.3"
"jest": "^29.7.0",
"jest-environment-node-single-context": "^29.1.0",
"prettier": "^3.0.3",
"ts-jest": "^29.1.1"
},
"engines": {
"node": "^18.0.0"
Expand Down
7 changes: 7 additions & 0 deletions test/unit/helpers/utils.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { getProposal } from '../../../src/helpers/utils';

describe('getProposal()', () => {
it.todo('returns null when the proposal is flagged');
it.todo('returns null when the proposal does not exist');
it.todo('returns the proposal');
});
Loading

0 comments on commit e354bd8

Please sign in to comment.