Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[review] Firestore関連のカスタムフックのテスト #1

Merged
merged 13 commits into from
Jul 22, 2024
5 changes: 5 additions & 0 deletions .firebaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"projects": {
"default": "demo-project"
}
}
25 changes: 25 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Test
on: [pull_request]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.X]
pnpm-version: [9]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Set up pnpm ${{ matrix.pnpm-version }}
uses: pnpm/action-setup@v3
with:
version: ${{ matrix.pnpm-version }}
run_install: true
- name: Install Firebase CLI
run: npm install -g firebase-tools
- name: Run tests
run: pnpm emulators:exec:test
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
node_modules/
dist/

# Firebase
*-debug.log
18 changes: 18 additions & 0 deletions firebase.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"emulators": {
"auth": {
"port": 9099
},
"firestore": {
"port": 8080
},
"storage": {
"port": 9199
},
"ui": {
"enabled": true,
"port": 4000
},
"singleProjectMode": true
}
}
23 changes: 21 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,27 +20,46 @@
"build": "npm run build:esm && npm run build:cjs",
"build:esm": "tsc",
"build:cjs": "tsc --project tsconfig.cjs.json",
"emulators:exec:test": "firebase emulators:exec 'pnpm test'",
"emulators:start": "firebase emulators:start",
"lint": "eslint --ext .js,.ts ./src",
"lint:fix": "eslint --fix --ext .js,.ts ./src",
"format": "prettier --write .",
"prepare": "npm run build"
"prepare": "npm run build",
"test": "vitest run --pool threads"
},
"keywords": [],
"author": "",
"license": "ISC",
"repository": {
"type": "git",
"url": "git+ssh://[email protected]/SonicGarden/react-fire-hooks.git"
},
"bugs": {
"url": "https://github.com/SonicGarden/react-fire-hooks/issues"
},
"homepage": "https://github.com/SonicGarden/react-fire-hooks#readme",
"peerDependencies": {
"firebase": "^9.0.0 || next",
"react": ">=16 || experimental"
},
"devDependencies": {
"@testing-library/react-hooks": "^8.0.1",
"@types/react": "^18.3.3",
"@typescript-eslint/eslint-plugin": "^7.14.1",
"@typescript-eslint/parser": "^7.14.1",
"@vitejs/plugin-react": "^4.3.1",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-import": "^2.29.1",
"firebase": "^10.12.3",
"firebase-admin": "^12.2.0",
"jsdom": "^24.1.0",
"prettier": "^3.3.2",
"typescript": "^5.5.2"
"react": "^18.3.1",
"react-test-renderer": "^18.3.1",
"typescript": "^5.5.2",
"vitest": "^2.0.2"
},
"pnpm": {
"updateConfig": {
Expand Down
Loading