<commit_before>var chai = require('chai')
  , should = chai.should()
  , RSVP = require('rsvp')
  , Promise = RSVP.Promise
  , TestQueue = require('../lib/queue.extensions')
  , Application = require('../lib/application')
  , UI = require('../lib/interface');

var debug = false;

var queue = new TestQueue({ debug: debug });
var ui = new UI( queue );
var application = new Application( queue, ui, { debug: debug } );
var belt = application.belt;
var services = application.services;

/*
  WALL --> NEW, CREATE, SELECT, DISPLAY, EDIT, UPDATE

  BOARD --> NEW, CREATE, SELECT, DISPLAY, EDIT, UPDATE

  CARD --> NEW, CREATE, EDIT, UPDATE, MOVE

  REGION --> NEW, CREATE, EDIT, UPDATE, MOVE, UPDATE

  TRANSFORM --> CREATE, UNLINK
*/

var _this = this;

var features = [
    'wall.new'
  , 'wall.create'
//, 'wall.select'
  , 'wall.display'
  , 'wall.edit'
  , 'wall.update'
  , 'board.new'
//, 'board.create'
//, 'board.select'
//, 'board.display'
//, 'board.edit'
//, 'board.update'
//, 'card.move'
];

Fixture('Application service API Features', function() {
    var fixture = {
        debug: debug
      , queue: queue
      , application: application
    };

    features.forEach(function( namespace ) {
        var feature = require( './features/' + namespace );

        Feature( feature.title, function() { feature.call( fixture ); } );
    });

    afterEach(function (done) {
        if (debug || this.currentTest.state === 'failed') console.log( queue.getCalls() );

        var promises =[];

        [ 'region', 'cardlocation', 'pocket', 'board', 'wall' ]
            .forEach(function( schema ) {
                var promise = belt.findMany( schema )
                    .then(function( resources ) {
                        if (!resources.length) return;

                        var promises = resources.map(function( resource ) {
                            return new Promise(function(resolve, reject) {
                                belt.delete( schema, resource.getId() )
                                    .then(function() {
                                        resolve();
                                    })
                                    .catch( reject );
                            });
                        });

                        return RSVP.all( promises );<commit_msg>made features test accept array of features<commit_after>var chai = require('chai')
  , should = chai.should()
  , RSVP = require('rsvp')
  , Promise = RSVP.Promise
  , TestQueue = require('../lib/queue.extensions')
  , Application = require('../lib/application')
  , UI = require('../lib/interface');

var debug = false;

var queue = new TestQueue({ debug: debug });
var ui = new UI( queue );
var application = new Application( queue, ui, { debug: debug } );
var belt = application.belt;
var services = application.services;

/*
  WALL --> NEW, CREATE, SELECT, DISPLAY, EDIT, UPDATE

  BOARD --> NEW, CREATE, SELECT, DISPLAY, EDIT, UPDATE

  CARD --> NEW, CREATE, EDIT, UPDATE, MOVE

  REGION --> NEW, CREATE, EDIT, UPDATE, MOVE, UPDATE

  TRANSFORM --> CREATE, UNLINK
*/

var _this = this;

var features = [
    'wall.new'
  , 'wall.create'
//, 'wall.select'
  , 'wall.display'
  , 'wall.edit'
  , 'wall.update'
  , 'board.new'
//, 'board.create'
//, 'board.select'
//, 'board.display'
//, 'board.edit'
//, 'board.update'
//, 'card.move'
];

Fixture('Application service API Features', function() {
    var fixture = {
        debug: debug
      , queue: queue
      , application: application
    };

    features.forEach(function( namespace ) {
        var features = require( './features/' + namespace );

        if (!features.length) {
            features = [ features ];
        }

        features.forEach(function( feature ) {
            Feature( feature.title, function() { feature.call( fixture ); } );
        });
    });

    afterEach(function (done) {
        if (debug || this.currentTest.state === 'failed') console.log( queue.getCalls() );

        var promises =[];

        [ 'region', 'cardlocation', 'pocket', 'board', 'wall' ]
            .forEach(function( schema ) {
                var promise = belt.findMany( schema )
                    .then(function( resources ) {
                        if (!resources.length) return;

                        var promises = resources.map(function( resource ) {
                            return new Promise(function(resolve, reject) {
                                belt.delete( schema, resource.getId() )
                                    .then(function() {
                                        resolve();
                                    })
                                    .catch( reject );
                            });
                        });

                        return RSVP.all( promises );
{'fraction_non_alphanumeric': 0.14606741573033707, 'fraction_numerical': 0.0, 'mean_word_length': 1.75947187141217, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6370171', 'n_tokens_mistral': 1381, 'n_tokens_neox': 1295, 'n_words': 332}