Skip to content

Commit 3e72f01

Browse files
committed
Now Jest testing is done after the npm build run - just as the Maven build. Also added some given - when - then for visibility.
1 parent dcc4ea7 commit 3e72f01

File tree

2 files changed

+17
-12
lines changed

2 files changed

+17
-12
lines changed

frontend/pom.xml

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -46,27 +46,29 @@
4646
<arguments>install</arguments>
4747
</configuration>
4848
</execution>
49+
<!-- Build and minify static files -->
50+
<execution>
51+
<id>npm run build</id>
52+
<goals>
53+
<goal>npm</goal>
54+
</goals>
55+
<configuration>
56+
<arguments>run build</arguments>
57+
</configuration>
58+
</execution>
4959
<!-- Run Unit tests -->
5060
<execution>
5161
<id>npm run test</id>
5262
<goals>
5363
<goal>npm</goal>
5464
</goals>
65+
<!-- optional: default phase is "generate-resources" -->
66+
<phase>test</phase>
5567
<!-- Optional configuration which provides for running any npm command -->
5668
<configuration>
5769
<arguments>run unit</arguments>
5870
</configuration>
5971
</execution>
60-
<!-- Build and minify static files -->
61-
<execution>
62-
<id>npm run build</id>
63-
<goals>
64-
<goal>npm</goal>
65-
</goals>
66-
<configuration>
67-
<arguments>run build</arguments>
68-
</configuration>
69-
</execution>
7072
</executions>
7173
</plugin>
7274
</plugins>

frontend/test/components/Hello.test.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,11 @@ import Hello from '@/components/Hello'
33

44
describe('Hello.vue', () => {
55
it('should render correct hello message', () => {
6-
const wrapper = shallowMount(Hello, { propsData: { hellomsg: 'Welcome to your Jest powered Vue.js App' } });
7-
const contentH1 = wrapper.find('h1');
6+
// Given
7+
const hellowrapped = shallowMount(Hello, { propsData: { hellomsg: 'Welcome to your Jest powered Vue.js App' } });
8+
// When
9+
const contentH1 = hellowrapped.find('h1');
10+
// Then
811
expect(contentH1.text()).toEqual('Welcome to your Jest powered Vue.js App');
912
})
1013
})

0 commit comments

Comments
 (0)