Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(vue3): adding e2e tests for sass-importer
- Loading branch information
Adam Hines
committed
Jun 24, 2022
1 parent
c5d1a69
commit 932c9bc
Showing
11 changed files
with
155 additions
and
1 deletion.
There are no files selected for viewing
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,4 @@ | ||
const { createTransformer } = require('babel-jest').default | ||
module.exports = createTransformer({ | ||
presets: ['@babel/preset-env'] | ||
}) |
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,24 @@ | ||
<template> | ||
<div> | ||
<h1 class="entry">Entry</h1> | ||
<lib-component /> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import LibComponent from 'vue3-sass-importer-lib/index.vue' | ||
export default { | ||
components: { | ||
LibComponent | ||
} | ||
} | ||
</script> | ||
|
||
<style lang="scss" module> | ||
@import '~vue3-sass-importer-sass-lib/index.scss'; | ||
.entry { | ||
@include my-v2-mixin; | ||
} | ||
</style> |
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,48 @@ | ||
{ | ||
"name": "vue3-sass-importer-entry", | ||
"version": "1.0.0", | ||
"license": "MIT", | ||
"private": true, | ||
"scripts": { | ||
"test": "jest --no-cache --coverage test.js" | ||
}, | ||
"dependencies": { | ||
"vue": "^3.2.22", | ||
"vue3-sass-importer-lib": "file:../lib", | ||
"vue3-sass-importer-sass-lib": "file:../sass-lib-v2" | ||
}, | ||
"devDependencies": { | ||
"@babel/core": "^7.9.0", | ||
"@babel/preset-env": "^7.9.0", | ||
"@vue/test-utils": "^1.1.0", | ||
"babel-jest": "^28.0.2", | ||
"jest": "28.x", | ||
"jest-environment-jsdom": "28.0.2", | ||
"postcss": "^7.0.13", | ||
"postcss-color-function": "^4.0.1", | ||
"sass": "^1.23.7", | ||
"@vue/vue3-jest": "^28.0.0" | ||
}, | ||
"jest": { | ||
"testEnvironment": "jsdom", | ||
"moduleFileExtensions": [ | ||
"js", | ||
"json", | ||
"vue" | ||
], | ||
"transformIgnorePatterns": [ | ||
"/node_modules/.*(?<!.vue)$" | ||
], | ||
"transform": { | ||
"^.+\\.js$": "./babel-transformer.js", | ||
"^.+\\.vue$": "@vue/vue3-jest" | ||
}, | ||
"globals": { | ||
"vue-jest": { | ||
"transform": { | ||
"^js$": "./babel-transformer.js" | ||
} | ||
} | ||
} | ||
} | ||
} |
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,7 @@ | ||
import { mount } from '@vue/test-utils' | ||
import Entry from './components/Entry.vue' | ||
|
||
test('processes sass imports relative to current file', () => { | ||
const wrapper = mount(Entry) | ||
expect(wrapper).toBeDefined() | ||
}) |
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 @@ | ||
<template> | ||
<div class="lib-class">Lib Component</div> | ||
</template> | ||
|
||
<style lang="scss" module> | ||
@import '~vue3-sass-importer-sass-lib/index.scss'; | ||
.lib-class { | ||
@include my-v1-mixin; | ||
} | ||
</style> |
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,19 @@ | ||
{ | ||
"name": "vue3-sass-importer-lib", | ||
"version": "1.0.0", | ||
"license": "MIT", | ||
"private": true, | ||
"main": "index.vue", | ||
"files": [ | ||
"index.vue" | ||
], | ||
"scripts": { | ||
"test": "echo 'No tests found.'" | ||
}, | ||
"dependencies": { | ||
"vue3-sass-importer-sass-lib": "file:../sass-lib-v1" | ||
}, | ||
"peerDependencies": { | ||
"vue": "^3.2.22" | ||
} | ||
} |
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,3 @@ | ||
@mixin my-v1-mixin { | ||
color: blue; | ||
} |
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,12 @@ | ||
{ | ||
"name": "vue3-sass-importer-sass-lib", | ||
"version": "1.0.0", | ||
"license": "MIT", | ||
"private": true, | ||
"files": [ | ||
"index.scss" | ||
], | ||
"scripts": { | ||
"test": "echo 'No tests found.'" | ||
} | ||
} |
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,3 @@ | ||
@mixin my-v2-mixin { | ||
color: red; | ||
} |
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,12 @@ | ||
{ | ||
"name": "vue3-sass-importer-sass-lib", | ||
"version": "2.0.0", | ||
"license": "MIT", | ||
"private": true, | ||
"files": [ | ||
"index.scss" | ||
], | ||
"scripts": { | ||
"test": "echo 'No tests found.'" | ||
} | ||
} |
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