Skip to content

Commit

Permalink
test: add back and update tests (nuxt#830)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe authored May 28, 2023
1 parent 69f8eb0 commit 3ffaa61
Show file tree
Hide file tree
Showing 18 changed files with 2,282 additions and 21 deletions.
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

0 comments on commit 3ffaa61

Please sign in to comment.