test: fix relative path
This commit is contained in:
@@ -3,11 +3,11 @@ import pkg from '~/package.json'
|
|||||||
|
|
||||||
const commitSha = (import.meta.env.VITE_COMMIT_REF || '').slice(0, 7)
|
const commitSha = (import.meta.env.VITE_COMMIT_REF || '').slice(0, 7)
|
||||||
const now = import.meta.env.VITE_APP_BUILD_TIME
|
const now = import.meta.env.VITE_APP_BUILD_TIME
|
||||||
const buildDate = (new Date(Number.parseInt(now) * 1000)).toLocaleDateString()
|
const buildDate = (new Date(Number.parseInt(now))).toLocaleDateString()
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div v-if="commitSha && buildDate" mb-2 text-sm>
|
<div mb-2 text-sm>
|
||||||
<span>
|
<span>
|
||||||
当前版本 v{{ pkg.version }}({{ buildDate }}):
|
当前版本 v{{ pkg.version }}({{ buildDate }}):
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import { acceptHMRUpdate, defineStore } from 'pinia'
|
import { acceptHMRUpdate, defineStore } from 'pinia'
|
||||||
import { useStorage } from '@vueuse/core'
|
import { useStorage } from '@vueuse/core'
|
||||||
import { ref } from 'vue'
|
import { ref } from 'vue'
|
||||||
import { defaultSettings } from '~/utils/settings'
|
import { defaultSettings } from '../../utils/settings'
|
||||||
import { namespace } from '~/constants'
|
import { namespace } from '../../constants'
|
||||||
|
|
||||||
export const useAppStore = defineStore('app', () => {
|
export const useAppStore = defineStore('app', () => {
|
||||||
const deferredPrompt = ref<Event | any>()
|
const deferredPrompt = ref<Event | any>()
|
||||||
|
|||||||
@@ -7,8 +7,7 @@ Object.assign(process.env, {
|
|||||||
})
|
})
|
||||||
|
|
||||||
// add build time to env
|
// add build time to env
|
||||||
import.meta.env.VITE_APP_BUILD_TIME = new Date().toISOString()
|
import.meta.env.VITE_APP_BUILD_TIME = new Date().getTime().toString()
|
||||||
|
|
||||||
export default defineNuxtConfig({
|
export default defineNuxtConfig({
|
||||||
ssr: false,
|
ssr: false,
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
"private": true,
|
"private": true,
|
||||||
"packageManager": "pnpm@8.14.3",
|
"packageManager": "pnpm@8.14.3",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=14"
|
"node": ">=16"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "npm run convert && nuxt build",
|
"build": "npm run convert && nuxt build",
|
||||||
|
|||||||
@@ -1,6 +1,13 @@
|
|||||||
|
import path from 'node:path'
|
||||||
import { defineVitestConfig } from '@nuxt/test-utils/config'
|
import { defineVitestConfig } from '@nuxt/test-utils/config'
|
||||||
|
|
||||||
export default defineVitestConfig({
|
export default defineVitestConfig({
|
||||||
|
resolve: {
|
||||||
|
alias: {
|
||||||
|
'~/': path.resolve(__dirname, './'),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
test: {
|
test: {
|
||||||
include: ['test/**/*.test.ts'],
|
include: ['test/**/*.test.ts'],
|
||||||
environment: 'nuxt',
|
environment: 'nuxt',
|
||||||
|
|||||||
Reference in New Issue
Block a user