You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+134-54
Original file line number
Diff line number
Diff line change
@@ -21,73 +21,153 @@ Macros are powerful to define chains of targets for different plugins that toget
21
21
22
22
Check the [Gruntfile](https://github.com/Bartvds/gruntfile-gtx/blob/master/Gruntfile.js) for practical [dogfooding](https://en.wikipedia.org/wiki/Dogfooding) and [browse the tests](https://github.com/Bartvds/gruntfile-gtx/tree/master/test/spec) for some more options.
23
23
24
-
### Practical example
24
+
### Example
25
25
26
-
The following snippets are lifted from the [gruntfile of TSD](https://github.com/DefinitelyTyped/tsd/blob/develop-0.5.x/Gruntfile.js) and show a macro to compile and run separated 'test modules'.
26
+
The following code block shows many of the enhancement features. The macro example is lifted from the [gruntfile of TSD](https://github.com/DefinitelyTyped/tsd/blob/develop-0.5.x/Gruntfile.js) and shows a macro to compile and run separated 'test modules'.
27
27
28
-
The use-case makes test easier to run by splitting the test-suite over multiple semi-isolated folders for rapid (partial) TDD. Additionally separate 'modules' can also be run concurrently to cutdown test duration for IO heavy topics.
28
+
This specific macro aims to make the different project modules easier to run by splitting the test-suite over multiple separate folders. Additionally separate 'modules' can also be run concurrently to cut-down on overall test-duration for IO heavy topics.
29
29
30
-
Note the macro uses a few plugins to setup and run: it would be a hassle to maintain these modules in a regular gruntfile but easy when using a macro to build the chains.
30
+
Note how the macro uses a few plugins to setup and run: it would be a hassle to maintain these modules in a regular gruntfile but it is easy when using a macro to build the chains.
31
31
32
32
33
33
````js
34
-
// define the macro
35
-
// note the macro object is a context with helpers to assemble a new instance named 'id'
36
-
gtx.define('module_tester', function (macro, id) {
37
-
// let's use the instance id to build the path
38
-
var testPath ='test/modules/'+ id +'/';
39
-
40
-
// create grunt-contrib-clean to remove old test output
41
-
macro.newTask('clean', [testPath +'tmp/**/*']);
42
-
43
-
// create grunt-ts task to compile the TypeScript test cases
0 commit comments