<commit_before>'use strict';

var f = require('util').format;

exports['Should Correctly Use Blurbird promises library'] = {
  metadata: {
    requires: {
      topology: ['single', 'ssl', 'wiredtiger']
    }
  },

  // The actual test we wish to run
  test: function(configuration, test) {
    var MongoClient = configuration.require.MongoClient,
      Promise = require('bluebird');

    MongoClient.connect(configuration.url(), {
      promiseLibrary: Promise,
      server: { sslValidate: false }
    }).then(function(client) {
      var db = client.db(configuration.database);
      var promise = db.collection('test').insert({ a: 1 });
      test.ok(promise instanceof Promise);

      promise.then(function() {
        client.close();
        test.done();
      });
    });
  }
};<commit_msg>test(byo-promises): convert `byo_promises` to mocha style<commit_after>'use strict';
var expect = require('chai').expect;

describe('Promises', function() {
  it('should Correctly Use Blurbird promises library', {
    metadata: {
      requires: {
        topology: ['single', 'ssl', 'wiredtiger']
      }
    },

    // The actual test we wish to run
    test: function(done) {
      var self = this;
      var MongoClient = self.configuration.require.MongoClient;
      var Promise = require('bluebird');

      MongoClient.connect(self.configuration.url(), {
        promiseLibrary: Promise,
        server: { sslValidate: false }
      }).then(function(client) {
        var db = client.db(self.configuration.db);
        var promise = db.collection('test').insert({ a: 1 });
        expect(promise).to.be.an.instanceOf(Promise);

        promise.then(function() {
          client.close();
          done();
        });
      });
    }
  });
});
{'fraction_non_alphanumeric': 0.14979988564894225, 'fraction_numerical': 0.0011435105774728416, 'mean_word_length': 2.7393162393162394, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5985677', 'n_tokens_mistral': 520, 'n_tokens_neox': 512, 'n_words': 114}