This repository was archived by the owner on Feb 26, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +28
-1
lines changed
events/defaultSubscribers Expand file tree Collapse file tree 4 files changed +28
-1
lines changed Original file line number Diff line number Diff line change @@ -48,6 +48,7 @@ const command = {
48
48
help : {
49
49
usage :
50
50
`truffle test [<test_file>] [--compile-all[-debug]] [--compile-none] ` +
51
+ `[--migrate-none] ` +
51
52
`[--network <name>]${ OS . EOL } ` +
52
53
`[--verbose-rpc] [--show-events] [--debug] ` +
53
54
`[--debug-global <identifier>] [--bail|-b]${ OS . EOL } ` +
@@ -75,6 +76,10 @@ const command = {
75
76
"Compile all contracts and do so in debug mode for extra revert info. May " +
76
77
"cause errors on large\n contracts."
77
78
} ,
79
+ {
80
+ option : "--migrate-none" ,
81
+ description : "Do not migrate any contracts before running the tests."
82
+ } ,
78
83
{
79
84
option : "--verbose-rpc" ,
80
85
description :
Original file line number Diff line number Diff line change @@ -106,7 +106,13 @@ const Test = {
106
106
107
107
const runner = new TestRunner ( config ) ;
108
108
109
- await this . performInitialDeploy ( config , testResolver ) ;
109
+ if ( config . migrateNone || config [ 'migrate-none' ] ) {
110
+ if ( config . events ) {
111
+ config . events . emit ( "migrate:skipped" ) ;
112
+ }
113
+ } else {
114
+ await this . performInitialDeploy ( config , testResolver ) ;
115
+ }
110
116
111
117
const sourcePaths = [ ]
112
118
. concat (
Original file line number Diff line number Diff line change 1
1
module . exports = {
2
2
compile : require ( "./compile" ) ,
3
+ migrate : require ( "./migrate" ) ,
3
4
init : require ( "./init" ) ,
4
5
obtain : require ( "./obtain" ) ,
5
6
unbox : require ( "./unbox" ) ,
Original file line number Diff line number Diff line change
1
+ module . exports = {
2
+ initialization : function ( ) {
3
+ this . logger = console ;
4
+ } ,
5
+ handlers : {
6
+ "migrate:skipped" : [
7
+ function ( ) {
8
+ if ( this . quiet ) return ;
9
+ this . logger . log (
10
+ `> Migration skipped because --migrate-none option was passed.`
11
+ ) ;
12
+ }
13
+ ]
14
+ }
15
+ } ;
You can’t perform that action at this time.
0 commit comments