Skip to content

Commit

Permalink
chore: restore sourcemap tests (#266)
Browse files Browse the repository at this point in the history
  • Loading branch information
sapphi-red committed Oct 12, 2023
1 parent 9cce3f9 commit c60119f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ exports[`serve:vue-sourcemap > js > serve-js 1`] = `
{
"mappings": "AAKA,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;;;;;;AAGP;AACd,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;;;;;;;;;;;wBARlB,oBAAiB,WAAd,MAAU",
"sources": [
"/root/Js.vue",
"Js.vue",
],
"sourcesContent": [
"<template>
Expand Down Expand Up @@ -192,7 +192,7 @@ exports[`serve:vue-sourcemap > no script > serve-no-script 1`] = `
"mappings": ";;;wBACE,oBAAwB,WAArB,aAAiB",
"sourceRoot": "",
"sources": [
"/root/NoScript.vue",
"NoScript.vue",
],
"sourcesContent": [
"<template>
Expand All @@ -208,7 +208,7 @@ exports[`serve:vue-sourcemap > no template > serve-no-template 1`] = `
{
"mappings": "AACA,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;;;;;;AAGP;AACd,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;;;;;;;",
"sources": [
"/root/NoTemplate.vue",
"NoTemplate.vue",
],
"sourcesContent": [
"<script>
Expand Down Expand Up @@ -314,7 +314,7 @@ exports[`serve:vue-sourcemap > ts > serve-ts 1`] = `
{
"mappings": ";AAKA,QAAQ,IAAI,WAAW;;;;;AAIvB,YAAQ,IAAI,UAAU;;;;;;;;uBARpB,oBAAiB,WAAd,MAAU",
"sources": [
"/root/Ts.vue",
"Ts.vue",
],
"sourcesContent": [
"<template>
Expand Down
12 changes: 4 additions & 8 deletions playground/vue-sourcemap/__tests__/vue-sourcemap.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,14 @@ describe.runIf(isServe)('serve:vue-sourcemap', () => {
throw new Error('Style not found: ' + content)
}

// Temporal skip after https://github.com/vitejs/vite/pull/12079
test.skip('js', async () => {
test('js', async () => {
const res = await page.request.get(new URL('./Js.vue', page.url()).href)
const js = await res.text()
const map = extractSourcemap(js)
expect(formatSourcemapForSnapshot(map)).toMatchSnapshot('serve-js')
})

// Temporal skip after https://github.com/vitejs/vite/pull/12079
test.skip('ts', async () => {
test('ts', async () => {
const res = await page.request.get(new URL('./Ts.vue', page.url()).href)
const js = await res.text()
const map = extractSourcemap(js)
Expand Down Expand Up @@ -93,8 +91,7 @@ describe.runIf(isServe)('serve:vue-sourcemap', () => {
)
})

// Temporal skip after https://github.com/vitejs/vite/pull/12079
test.skip('no script', async () => {
test('no script', async () => {
const res = await page.request.get(
new URL('./NoScript.vue', page.url()).href,
)
Expand All @@ -103,8 +100,7 @@ describe.runIf(isServe)('serve:vue-sourcemap', () => {
expect(formatSourcemapForSnapshot(map)).toMatchSnapshot('serve-no-script')
})

// Temporal skip after https://github.com/vitejs/vite/pull/12079
test.skip('no template', async () => {
test('no template', async () => {
const res = await page.request.get(
new URL('./NoTemplate.vue', page.url()).href,
)
Expand Down

0 comments on commit c60119f

Please sign in to comment.