@@ -13,24 +13,24 @@ describe('module - default', function () {
13
13
this . timeout ( 600000 ) ;
14
14
15
15
describe ( 'deploy' , function ( ) {
16
- it ( 'should deploy meteor app on "meteor" vm' , async done => {
16
+ it ( 'should deploy meteor app on "meteor" vm' , async ( ) => {
17
17
const serverInfo = servers [ 'mymeteor' ] ;
18
18
sh . cd ( path . resolve ( '/tmp' , 'tests/project-1' ) ) ;
19
19
sh . exec ( 'mup setup' ) ;
20
20
21
21
const out = sh . exec ( 'mup deploy' ) ;
22
22
23
23
expect ( out . code ) . to . be . equal ( 0 ) ;
24
- expect ( countOccurences ( 'Bulding App Bundle Locally' , out . output ) ) . to . be . equal ( 1 ) ;
24
+ expect ( countOccurences ( 'Building App Bundle Locally' , out . output ) ) . to . be . equal ( 1 ) ;
25
25
expect ( countOccurences ( 'Pushing Meteor App Bundle to The Server: SUCCESS' , out . output ) ) . to . be . equal ( 1 ) ;
26
26
expect ( countOccurences ( 'Pushing the Startup Script: SUCCESS' , out . output ) ) . to . be . equal ( 1 ) ;
27
27
expect ( countOccurences ( 'Sending Environment Variables: SUCCESS' , out . output ) ) . to . be . equal ( 1 ) ;
28
28
expect ( countOccurences ( 'Start Meteor: SUCCESS' , out . output ) ) . to . be . equal ( 1 ) ;
29
29
expect ( countOccurences ( 'Verifying Deployment: SUCCESS' , out . output ) ) . to . be . equal ( 1 ) ;
30
- expect ( ( await runSSHCommand ( serverInfo , 'nc -z -v -w5 localhost 27017' ) ) . code ) . to . be . equal ( 0 ) ;
31
- expect ( ( await runSSHCommand ( serverInfo , 'curl localhost:80 && exit 0' ) ) . code ) . to . be . equal ( 0 ) ;
32
-
33
- done ( ) ;
30
+ const ssh1 = await runSSHCommand ( serverInfo , 'nc -z -v -w5 localhost 27017' ) ;
31
+ expect ( ssh1 . code ) . to . be . equal ( 0 ) ;
32
+ const ssh2 = await runSSHCommand ( serverInfo , 'curl localhost:80 && exit 0' ) ;
33
+ expect ( ssh2 . code ) . to . be . equal ( 0 ) ;
34
34
} ) ;
35
35
} ) ;
36
36
@@ -39,29 +39,27 @@ describe('module - default', function () {
39
39
} ) ;
40
40
41
41
describe ( 'init' , function ( ) {
42
- it ( 'should create "mup.js" and "setting.json" in ./tests /project-2 ' , done => {
43
- const dir = '../../../../tests /project-tmp' ;
42
+ it ( 'should create "mup.js" and "setting.json" in /tmp /project-tmp ' , ( ) => {
43
+ const dir = '/tmp /project-tmp' ;
44
44
sh . mkdir ( dir ) ;
45
45
sh . cd ( dir ) ;
46
46
sh . exec ( 'mup init' ) ;
47
47
expect ( fs . existsSync ( path . resolve ( dir , 'mup.js' ) ) ) . to . true ;
48
48
expect ( fs . existsSync ( path . resolve ( dir , 'settings.json' ) ) ) . to . true ;
49
49
sh . rm ( '-rf' , dir ) ;
50
- done ( ) ;
51
50
} ) ;
52
51
} ) ;
53
52
54
53
describe ( 'logs' , function ( ) {
55
- it ( 'should pull the logs from meteor app' , done => {
54
+ it ( 'should pull the logs from meteor app' , ( ) => {
56
55
sh . cd ( path . resolve ( '/tmp/' , 'tests/project-1' ) ) ;
57
56
const out = sh . exec ( 'mup logs' ) ;
58
57
expect ( out . code ) . to . be . equal ( 0 ) ;
59
- done ( ) ;
60
58
} ) ;
61
59
} ) ;
62
60
63
61
describe ( 'reconfig' , function ( ) {
64
- it ( 'should reconfig meteor app on "meteor" vm' , async done => {
62
+ it ( 'should reconfig meteor app on "meteor" vm' , async ( ) => {
65
63
const serverInfo = servers [ 'mymeteor' ] ;
66
64
sh . cd ( path . resolve ( '/tmp' , 'tests/project-1' ) ) ;
67
65
sh . exec ( 'mup setup && mup deploy' ) ;
@@ -73,13 +71,11 @@ describe('module - default', function () {
73
71
expect ( countOccurences ( 'Start Meteor: SUCCESS' , out . output ) ) . to . be . equal ( 1 ) ;
74
72
expect ( countOccurences ( 'Verifying Deployment: SUCCESS' , out . output ) ) . to . be . equal ( 1 ) ;
75
73
expect ( ( await runSSHCommand ( serverInfo , 'curl localhost:80 && exit 0' ) ) . code ) . to . be . equal ( 0 ) ;
76
-
77
- done ( ) ;
78
74
} ) ;
79
75
} ) ;
80
76
81
77
describe ( 'restart' , function ( ) {
82
- it ( 'should restart meteor app on "meteor" vm' , async done => {
78
+ it ( 'should restart meteor app on "meteor" vm' , async ( ) => {
83
79
const serverInfo = servers [ 'mymeteor' ] ;
84
80
sh . cd ( path . resolve ( '/tmp' , 'tests/project-1' ) ) ;
85
81
sh . exec ( 'mup setup && mup deploy' ) ;
@@ -91,13 +87,11 @@ describe('module - default', function () {
91
87
expect ( countOccurences ( 'Start Meteor: SUCCESS' , out . output ) ) . to . be . equal ( 1 ) ;
92
88
expect ( countOccurences ( 'Verifying Deployment: SUCCESS' , out . output ) ) . to . be . equal ( 1 ) ;
93
89
expect ( ( await runSSHCommand ( serverInfo , 'curl localhost:80 && exit 0' ) ) . code ) . to . be . equal ( 0 ) ;
94
-
95
- done ( ) ;
96
90
} ) ;
97
91
} ) ;
98
92
99
93
describe ( 'setup' , function ( ) {
100
- it ( 'should setup "meteor" vm' , async done => {
94
+ it ( 'should setup "meteor" vm' , async ( ) => {
101
95
const serverInfo = servers [ 'mymeteor' ] ;
102
96
sh . cd ( path . resolve ( '/tmp' , 'tests/project-1' ) ) ;
103
97
@@ -108,30 +102,26 @@ describe('module - default', function () {
108
102
expect ( countOccurences ( 'setup environment: SUCCESS' , out . output ) ) . to . be . equal ( 1 ) ;
109
103
expect ( countOccurences ( 'start mongo: SUCCESS' , out . output ) ) . to . be . equal ( 1 ) ;
110
104
expect ( ( await runSSHCommand ( serverInfo , 'nc -z -v -w5 localhost 27017' ) ) . code ) . to . be . equal ( 0 ) ;
111
-
112
- done ( ) ;
113
105
} ) ;
114
106
} ) ;
115
107
116
108
describe ( 'start' , function ( ) {
117
- it ( 'should start meteor app on "meteor" vm' , async done => {
109
+ it ( 'should start meteor app on "meteor" vm' , async ( ) => {
118
110
const serverInfo = servers [ 'mymeteor' ] ;
119
111
sh . cd ( path . resolve ( '/tmp' , 'tests/project-1' ) ) ;
120
- sh . exec ( 'mup setup && mup deploy && mup stop ' ) ;
112
+ sh . exec ( 'mup setup && mup meteor push && mup meteor envconfig ' ) ;
121
113
122
114
const out = sh . exec ( 'mup start' ) ;
123
115
124
116
expect ( out . code ) . to . be . equal ( 0 ) ;
125
117
expect ( countOccurences ( 'Start Meteor: SUCCESS' , out . output ) ) . to . be . equal ( 1 ) ;
126
118
expect ( countOccurences ( 'Verifying Deployment: SUCCESS' , out . output ) ) . to . be . equal ( 1 ) ;
127
119
expect ( ( await runSSHCommand ( serverInfo , 'curl localhost:80 && exit 0' ) ) . code ) . to . be . equal ( 0 ) ;
128
-
129
- done ( ) ;
130
120
} ) ;
131
121
} ) ;
132
122
133
123
describe ( 'stop' , function ( ) {
134
- it ( 'should stop meteor app on "meteor" vm' , async done => {
124
+ it ( 'should stop meteor app on "meteor" vm' , async ( ) => {
135
125
const serverInfo = servers [ 'mymeteor' ] ;
136
126
sh . cd ( path . resolve ( '/tmp' , 'tests/project-1' ) ) ;
137
127
sh . exec ( 'mup setup && mup deploy' ) ;
@@ -141,15 +131,13 @@ describe('module - default', function () {
141
131
expect ( out . code ) . to . be . equal ( 0 ) ;
142
132
expect ( countOccurences ( 'Stop Meteor: SUCCESS' , out . output ) ) . to . be . equal ( 1 ) ;
143
133
expect ( ( await runSSHCommand ( serverInfo , 'curl localhost:80 && exit 0' ) ) . code ) . to . be . equal ( 7 ) ;
144
-
145
- done ( ) ;
146
134
} ) ;
147
135
} ) ;
148
136
149
137
describe ( 'syslog' , function ( ) {
150
138
const serverInfo = servers [ 'mymeteor' ] ;
151
139
152
- it ( 'should write meteor logst to syslog on "meteor" vm' , async done => {
140
+ it ( 'should write meteor logst to syslog on "meteor" vm' , async ( ) => {
153
141
154
142
sh . cd ( path . resolve ( '/tmp' , 'tests/project-2' ) ) ;
155
143
@@ -158,8 +146,6 @@ describe('module - default', function () {
158
146
expect ( out . code ) . to . be . equal ( 0 ) ;
159
147
160
148
expect ( countOccurences ( '=> Starting meteor app on port:80' , out . output ) ) . gte ( 1 ) ;
161
-
162
- done ( ) ;
163
149
} ) ;
164
150
} ) ;
165
151
} ) ;
0 commit comments