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

test: add back and update tests #830

Merged
merged 15 commits into from
May 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
- run: pnpm install
- run: pnpm dev:prepare
- run: pnpm lint
- run: pnpm test
- run: pnpm build
- run: pnpm dev:build
- name: Release Edge
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ node_modules
.nuxt
*.log
cache/
dist/
dist
.DS_Store
coverage
sw.*
Expand Down
3 changes: 2 additions & 1 deletion .nuxtrc
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
imports.autoImport=false
modules[]=nuxt-vitest
modules[]=@nuxt/image-edge
12 changes: 10 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"lint": "eslint --ext .ts --ext .vue .",
"prepack": "pnpm build",
"release": "pnpm test && standard-version && git push --follow-tags && npm publish",
"test": "pnpm lint"
"test": "nuxi prepare playground && pnpm vitest run"
},
"dependencies": {
"@nuxt/kit": "^3.5.1",
Expand All @@ -35,14 +35,22 @@
"ufo": "^1.1.2"
},
"devDependencies": {
"@nuxt/image-edge": "link:.",
"@nuxt/module-builder": "0.4.0",
"@nuxt/test-utils": "^3.5.1",
"@nuxtjs/eslint-config-typescript": "^12.0.0",
"@types/node": "^18.16.15",
"@vitest/coverage-c8": "^0.30.1",
"@vue/test-utils": "^2.3.2",
"eslint": "8.41.0",
"globby": "^13.1.4",
"jiti": "1.18.2",
"nuxt": "^3.5.1",
"nuxt-vitest": "^0.7.1",
"playwright": "^1.34.3",
"standard-version": "latest",
"typescript": "5.0.4"
"typescript": "5.0.4",
"vitest": "^0.30.1"
},
"optionalDependencies": {
"ipx": "1.1.0"
Expand Down
27 changes: 13 additions & 14 deletions playground/pages/provider/[provider].vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,24 @@
</div>
</template>

<script lang="ts">
<script setup lang="ts">
import { providers } from '../../providers'

export default {
definePageMeta({
validate ({ params }) {
return Boolean(providers.find(p => p.name === params.provider))
},
computed: {
providers: () => providers,
provider () {
const providerName = this.$route.params.provider || 'default'
const p = providers.find(p => p.name === providerName)
if (!p) {
return null
}
return p
}
}
}
})

const route = useRoute()
const provider = computed(() => {
const providerName = route.params.provider || 'default'
const p = providers.find(p => p.name === providerName)
if (!p) {
return null
}
return p
})
</script>

<style scoped>
Expand Down
Loading