Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: vuejs/vue-jest
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v29.2.1
Choose a base ref
...
head repository: vuejs/vue-jest
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v29.2.2
Choose a head ref
  • 1 commit
  • 2 files changed
  • 1 contributor

Commits on Dec 11, 2022

  1. fix: Map lines for script block (#516)

    Signed-off-by: Wolfgang Walther <walther@technowledgy.de>
    
    Signed-off-by: Wolfgang Walther <walther@technowledgy.de>
    wolfgangwalther authored Dec 11, 2022

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    33daf44 View commit details
Showing with 28 additions and 16 deletions.
  1. +27 −16 e2e/2.x/basic/__snapshots__/test.js.snap
  2. +1 −0 packages/vue2-jest/lib/process.js
43 changes: 27 additions & 16 deletions e2e/2.x/basic/__snapshots__/test.js.snap
Original file line number Diff line number Diff line change
@@ -3,25 +3,35 @@
exports[`generates source maps for .vue files 1`] = `
{
"file": "./components/Basic.vue",
"mappings": ";;;;;;eACe;AACbA,MAAI,EAAE,OADO;AAEbC,UAAQ,EAAE;AACRC,kBAAc,EAAE,SAASA,cAAT,GAA0B;AACxC,aAAO;AACLC,WAAG,EAAE,KAAKC,OADL;AAELC,YAAI,EAAE,CAAC,KAAKD,OAFP;AAGLE,cAAM,EAAE,KAAKF;AAHR,OAAP;AAKD;AAPO,GAFG;AAWbG,MAAI,EAAE,SAASA,IAAT,GAAgB;AACpB,WAAO;AACLC,SAAG,EAAE,4BADA;AAELJ,aAAO,EAAE;AAFJ,KAAP;AAID,GAhBY;AAiBbK,SAAO,EAAE;AACPC,eAAW,EAAE,SAASA,WAAT,GAAuB;AAClC,WAAKN,OAAL,GAAe,CAAC,KAAKA,OAArB;AACD;AAHM;AAjBI,C",
"names": [
"name",
"computed",
"headingClasses",
"red",
"isCrazy",
"blue",
"shadow",
"data",
"msg",
"methods",
"toggleClass",
],
"mappings": ";;;;;;eAuBe;AACb,MAAI,EAAE,OADO;AAEb,UAAQ,EAAE;AACR,kBAAc,EAAE,SAAS,cAAT,GAA0B;AACxC,aAAO;AACL,WAAG,EAAE,KAAK,OADL;AAEL,YAAI,EAAE,CAAC,KAAK,OAFP;AAGL,cAAM,EAAE,KAAK;AAHR,OAAP;AAKD;AAPO,GAFG;AAWb,MAAI,EAAE,SAAS,IAAT,GAAgB;AACpB,WAAO;AACL,SAAG,EAAE,4BADA;AAEL,aAAO,EAAE;AAFJ,KAAP;AAID,GAhBY;AAiBb,SAAO,EAAE;AACP,eAAW,EAAE,SAAS,WAAT,GAAuB;AAClC,WAAK,OAAL,GAAe,CAAC,KAAK,OAArB;AACD;AAHM;AAjBI",
"names": [],
"sources": [
"Basic.vue",
"components/Basic.vue",
],
"sourcesContent": [
"
"<template>
<div class="hello">
<h1 :class="headingClasses">{{ msg }}</h1>
</div>
</template>
<style module="css">
.testA {
background-color: red;
}
</style>
<style module>
.testB {
background-color: blue;
}
</style>
<style>
.testC {
background-color: blue;
}
</style>
<script>
export default {
name: 'basic',
computed: {
@@ -45,6 +55,7 @@ export default {
}
}
}
</script>
",
],
"version": 3,
1 change: 1 addition & 0 deletions packages/vue2-jest/lib/process.js
Original file line number Diff line number Diff line change
@@ -48,6 +48,7 @@ function processScript(scriptPart, filePath, config) {

const result = transformer.process(scriptPart.content, filePath, config)
result.code = stripInlineSourceMap(result.code)
result.map = mapLines(scriptPart.map, result.map)
result.externalSrc = externalSrc
return result
}