Skip to content

Commit

Permalink
simplify test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
michalzaq12 committed Aug 30, 2019
1 parent 2c17166 commit bbc5caf
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 47 deletions.
8 changes: 2 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,8 @@ os:
env:
matrix:
- TEST_SUITE=typescript
- TEST_SUITE=buefy
- TEST_SUITE=vuetify
- TEST_SUITE=element
- TEST_SUITE=sass
- TEST_SUITE=less
- TEST_SUITE=stylus
- TEST_SUITE=css_frameworks
- TEST_SUITE=loaders
- TEST_SUITE=eslint
global:
- USE_HARD_LINKS=true
Expand Down
12 changes: 6 additions & 6 deletions template/test/e2e/specs/css-framework.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {beforeEach, afterEachAlways, sleep} from "../helpers";
test.beforeEach(beforeEach);
test.afterEach.always(afterEachAlways);

{{#if_eq cssFramework 'vuetify'}}

test('vuetify should render button component', async t => {
const app = t.context.app;

Expand All @@ -18,9 +18,9 @@ test('vuetify should render button component', async t => {
t.fail(e.message);
}
})
{{/if_eq}}

{{#if_eq cssFramework 'buefy'}}


test('buefy should render button component', async t => {
const app = t.context.app;

Expand All @@ -33,9 +33,9 @@ test('buefy should render button component', async t => {
t.fail(e.message);
}
})
{{/if_eq}}

{{#if_eq cssFramework 'element'}}


test('Element should render button component', async t => {
const app = t.context.app;

Expand All @@ -48,4 +48,4 @@ test('Element should render button component', async t => {
t.fail(e.message);
}
})
{{/if_eq}}

12 changes: 6 additions & 6 deletions template/test/e2e/specs/loader.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ test.afterEach.always(afterEachAlways);

const RED_HEX = '#ff0000';

{{#if_eq cssPreprocessor 'sass'}}

test('sass', async t => {
const app = t.context.app;
const ELEMENT_SELECTOR = '.sass__text--red';
Expand All @@ -24,9 +24,9 @@ test('sass', async t => {
t.fail(e.message);
}
})
{{/if_eq}}

{{#if_eq cssPreprocessor 'less'}}


test('less', async t => {
const app = t.context.app;
const ELEMENT_SELECTOR = '.less__text--red';
Expand All @@ -41,9 +41,9 @@ test('less', async t => {
t.fail(e.message);
}
})
{{/if_eq}}

{{#if_eq cssPreprocessor 'stylus'}}


test('stylus', async t => {
const app = t.context.app;
const ELEMENT_SELECTOR = '.stylus__text--red';
Expand All @@ -58,4 +58,4 @@ test('stylus', async t => {
t.fail(e.message);
}
})
{{/if_eq}}

24 changes: 4 additions & 20 deletions tests/scenarios.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,29 +26,13 @@ const scenarios = {
...defaultValues,
typescript: true
},
sass: {
loaders: {
...defaultValues,
cssPreprocessor: 'sass'
cssPreprocessor: 'all'
},
less: {
css_frameworks: {
...defaultValues,
cssPreprocessor: 'less'
},
stylus: {
...defaultValues,
cssPreprocessor: 'stylus'
},
vuetify: {
...defaultValues,
cssFramework: 'vuetify'
},
buefy: {
...defaultValues,
cssFramework: 'buefy'
},
element: {
...defaultValues,
cssFramework: 'element'
cssFramework: 'all'
}
}

Expand Down
16 changes: 7 additions & 9 deletions tests/vue-cli-filters.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
const TEST_SUITE = process.env.TEST_SUITE
module.exports = {
'src/renderer/pages/test/**/*': 'isCIServer',

'src/renderer/pages/test/css-framework/buefy.vue': 'cssFramework === \'buefy\'',
'src/renderer/pages/test/css-framework/vuetify.vue': 'cssFramework === \'vuetify\'',
'src/renderer/pages/test/css-framework/element.vue': 'cssFramework === \'element\'',
'src/renderer/pages/test/loader/less.vue': 'cssPreprocessor === \'less\'',
'src/renderer/pages/test/loader/sass.vue': 'cssPreprocessor === \'sass\'',
'src/renderer/pages/test/loader/stylus.vue': 'cssPreprocessor === \'stylus\'',
'src/renderer/pages/test/css-framework/**/*': TEST_SUITE === 'css_frameworks',
'test/e2e/spec/css-framework.spec.js': TEST_SUITE === 'css_frameworks',

'src/renderer/pages/test/typescript/**/*': 'typescript',
'src/renderer/pages/test/loader/**/*': process.env.TEST_SUITE === 'loaders',
'test/e2e/spec/loader.spec.js': process.env.TEST_SUITE === 'loaders',

'test/e2e/spec/css-framework.spec.js': 'isCIServer',
'test/e2e/spec/loader.spec.js': 'isCIServer'
'src/renderer/pages/test/typescript/**/*': process.env.TEST_SUITE === 'typescript',
//TODO add e2e typescript test
}

0 comments on commit bbc5caf

Please sign in to comment.