-
Notifications
You must be signed in to change notification settings - Fork 320
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #418 from fdc-viktor-luft/vl/239
Add tests for Vue
- Loading branch information
Showing
12 changed files
with
2,091 additions
and
5,890 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,4 @@ class ExportClass { | |
} | ||
} | ||
|
||
export = ExportClass; | ||
export default ExportClass; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,4 @@ class ExportClass { | |
} | ||
} | ||
|
||
export = ExportClass; | ||
export default ExportClass; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* eslint-env mocha */ | ||
'use strict'; | ||
|
||
const madge = require('../lib/api'); | ||
require('should'); | ||
|
||
describe('Vue', () => { | ||
const dir = __dirname + '/vue'; | ||
// this seems necessary to run the tests successfully | ||
const emptyTsConfig = {compilerOptions: {}}; | ||
|
||
it('finds import in Vue files using TS', (done) => { | ||
madge(dir + '/BasicComponentTs.vue', {tsConfig: emptyTsConfig}).then((res) => { | ||
res.obj().should.eql({ | ||
'one.ts': [], | ||
'BasicComponentTs.vue': ['OneNestedTs.vue', 'TwoNested.vue'], | ||
'OneNestedTs.vue': ['ThreeNested.vue', 'one.ts'], | ||
'ThreeNested.vue': [], | ||
'TwoNested.vue': [] | ||
}); | ||
done(); | ||
}).catch(done); | ||
}); | ||
|
||
it('finds import in Vue files', (done) => { | ||
madge(dir + '/BasicComponent.vue', {tsConfig: emptyTsConfig}).then((res) => { | ||
res.obj().should.eql({ | ||
'two.js': [], | ||
'BasicComponent.vue': ['OneNested.vue', 'TwoNested.vue'], | ||
'OneNested.vue': ['ThreeNested.vue', 'two.js'], | ||
'ThreeNested.vue': [], | ||
'TwoNested.vue': [] | ||
}); | ||
done(); | ||
}).catch(done); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<script setup> | ||
import OneNested from './OneNested.vue'; | ||
import TwoNested from './TwoNested.vue'; | ||
</script> | ||
|
||
<template> | ||
<OneNested /> | ||
<TwoNested /> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<script lang="ts" setup> | ||
import OneNested from './OneNestedTs.vue'; | ||
import TwoNested from './TwoNested.vue'; | ||
</script> | ||
|
||
<template> | ||
<OneNested /> | ||
<TwoNested /> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<script setup> | ||
import { ref } from "vue"; | ||
import ThreeNested from "./ThreeNested.vue"; | ||
import "./two"; | ||
const count = ref(0); | ||
</script> | ||
|
||
<template> | ||
<button @click="count++">{{ count }}</button> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<script lang="ts" setup> | ||
import { ref } from "vue"; | ||
import ThreeNested from "./ThreeNested.vue"; | ||
import "./one"; | ||
const count = ref(0); | ||
</script> | ||
|
||
<template> | ||
<button @click="count++">{{ count }}</button> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<template>Content without deps</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<template>Content without deps</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
// no content |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
// no content |