22
33'use strict'
44
5- var async = require ( 'async' )
65var fixtures = require ( './fixtures' )
76var fs = require ( 'fs' )
87var glob = require ( 'glob' )
@@ -20,8 +19,8 @@ var output = glob.sync('**/*', {cwd: base, nodir: true}).reduce(function (obj, n
2019 return obj
2120} , { } )
2221
23- var clearInfo = function ( key , cb ) {
24- cb ( ! ~ [ 'info' , 'index' ] . indexOf ( key ) )
22+ var clearInfo = function ( key ) {
23+ return ! ~ [ 'info' , 'index' ] . indexOf ( key )
2524}
2625
2726var itShouldHaveTests = function ( test , func , key ) {
@@ -74,7 +73,7 @@ describe('Available Targets', function () {
7473} )
7574
7675// test all the things!
77- async . each ( Object . keys ( targets ) , function ( target ) {
76+ Object . keys ( targets ) . forEach ( function ( target ) {
7877 describe ( targets [ target ] . info . title , function ( ) {
7978 itShouldHaveInfo ( targets , target )
8079
@@ -86,35 +85,29 @@ async.each(Object.keys(targets), function (target) {
8685
8786 if ( ! targets [ target ] . index ) {
8887 describe ( 'snippets' , function ( ) {
89- async . filter ( Object . keys ( fixtures . requests ) , clearInfo , function ( requests ) {
90- async . each ( requests , function ( request ) {
91- itShouldHaveRequestTestOutputFixture ( request , target , '' )
88+ Object . keys ( fixtures . requests ) . filter ( clearInfo ) . forEach ( function ( request ) {
89+ itShouldHaveRequestTestOutputFixture ( request , target , '' )
9290
93- itShouldGenerateOutput ( request , target + '/' , target )
94- } )
91+ itShouldGenerateOutput ( request , target + '/' , target )
9592 } )
9693 } )
9794 }
9895
99- async . filter ( Object . keys ( targets [ target ] ) , clearInfo , function ( clients ) {
100- async . each ( clients , function ( client ) {
101- describe ( client , function ( ) {
102- itShouldHaveInfo ( targets [ target ] , client )
96+ Object . keys ( targets [ target ] ) . filter ( clearInfo ) . forEach ( function ( client ) {
97+ describe ( client , function ( ) {
98+ itShouldHaveInfo ( targets [ target ] , client )
10399
104- itShouldHaveTests ( tests [ target ] , client , client )
100+ itShouldHaveTests ( tests [ target ] , client , client )
105101
106- if ( tests [ target ] && typeof tests [ target ] [ client ] === 'function' ) {
107- tests [ target ] [ client ] ( HTTPSnippet , fixtures )
108- }
102+ if ( tests [ target ] && typeof tests [ target ] [ client ] === 'function' ) {
103+ tests [ target ] [ client ] ( HTTPSnippet , fixtures )
104+ }
109105
110- describe ( 'snippets' , function ( ) {
111- async . filter ( Object . keys ( fixtures . requests ) , clearInfo , function ( requests ) {
112- async . each ( requests , function ( request ) {
113- itShouldHaveRequestTestOutputFixture ( request , target , client + '/' )
106+ describe ( 'snippets' , function ( ) {
107+ Object . keys ( fixtures . requests ) . filter ( clearInfo ) . forEach ( function ( request ) {
108+ itShouldHaveRequestTestOutputFixture ( request , target , client + '/' )
114109
115- itShouldGenerateOutput ( request , target + '/' + client + '/' , target , client )
116- } )
117- } )
110+ itShouldGenerateOutput ( request , target + '/' + client + '/' , target , client )
118111 } )
119112 } )
120113 } )
0 commit comments