Skip to content

Commit 9f486ae

Browse files
committed
chore: fix tests
1 parent 2b7002c commit 9f486ae

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,7 @@
5353
"release": "pnpm build && bumpp -x \"npx changelogen --output=CHANGELOG.md\" && pnpm publish",
5454
"lint": "eslint .",
5555
"lint:fix": "eslint . --fix",
56-
"test": "pnpm dev:prepare && vitest --run --exclude **/__runtime__ && pnpm test:runtime",
57-
"test:runtime": "cd test/fixtures/basic && vitest --run",
56+
"test": "pnpm dev:prepare && vitest --run",
5857
"test:types": "echo 'broken due to type regeneration, use pnpm typecheck' && npx nuxi typecheck"
5958
},
6059
"build": {

src/plugins/transform.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,10 +167,10 @@ export function NuxtScriptBundleTransformer(options: AssetBundlerTransformerOpti
167167
let src: false | string | undefined
168168
if (fnName === 'useScript') {
169169
// do easy case first where first argument is a literal
170-
if (node.arguments[0].type === 'Literal') {
170+
if (node.arguments[0]?.type === 'Literal') {
171171
scriptSrcNode = node.arguments[0] as Literal & { start: number, end: number }
172172
}
173-
else if (node.arguments[0].type === 'ObjectExpression') {
173+
else if (node.arguments[0]?.type === 'ObjectExpression') {
174174
const srcProperty = node.arguments[0].properties.find(
175175
(p: any) => (p.key?.name === 'src' || p.key?.value === 'src') && p?.value.type === 'Literal',
176176
)

0 commit comments

Comments
 (0)