text: "use strict";
  
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
  
  var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
  
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
  
  require("@babel/register");
  
  var _ava = _interopRequireDefault(require("ava"));
  
  var _Test = _interopRequireDefault(require("../../src/database/Test"));
  
  var _Users = _interopRequireDefault(require("../../src/collection/Users"));
  
  _ava.default.before(
  /*#__PURE__*/
  function () {
    var _ref = (0, _asyncToGenerator2.default)(
    /*#__PURE__*/
    _regenerator.default.mark(function _callee(it) {
      var test, db, users;
      return _regenerator.default.wrap(function _callee$(_context) {
        while (1) {
          switch (_context.prev = _context.next) {
            case 0:
              test = new _Test.default();
              _context.next = 3;
              return test.getDatabase();
  
            case 3:
              db = _context.sent;
              users = new _Users.default({
                db: db
              });
              it.context.users = users;
  
            case 6:
            case "end":
              return _context.stop();
          }
        }
      }, _callee, this);
    }));
  
    return function (_x) {
      return _ref.apply(this, arguments);
    };
  }()); //test('[collection] -> User :: find;', async it => {
  //const result = await it.context.users.find();
  //it.deepEqual(JSON.stringify(result), '[]');
  //});
  //test('[collection] -> User :: insert;', async it => {
  //const user = { "_id": 1, "name": "Paul Allen" };
  //await it.context.users.insert(user);
  //const result = await it.context.users.find();
  //it.deepEqual(JSON.stringify(result), '[{"_id":1,"name":"Paul Allen"}]');
  //});
  //test('[collection] -> User :: update;', async it => {
  //const selector = { _id: 1 };
  //const document = { $set: {  _id: 1, "name": "Yuki Hsu" } };
  //await it.context.users.updateOne(selector, document);
  //const result = await it.context.users.find();
  //it.deepEqual(JSON.stringify(result), '[{"_id":1,"name":"Yuki Hsu"}]');
  //});
  
  
  (0, _ava.default)('[collection] -> User :: delete;',
  /*#__PURE__*/
  function () {
    var _ref2 = (0, _asyncToGenerator2.default)(
    /*#__PURE__*/
    _regenerator.default.mark(function _callee2(it) {
      var filter, result;
      return _regenerator.default.wrap(function _callee2$(_context2) {
        while (1) {
          switch (_context2.prev = _context2.next) {
            case 0:
              filter = {
                "_id": 1
              };
              _context2.next = 3;
              return it.context.users.delete(filter);
  
            case 3:
              _context2.next = 5;
              return it.context.users.find();
  
            case 5:
              result = _context2.sent;
              it.deepEqual(JSON.stringify(result), '[]');
  
            case 7:
            case "end":
              return _context2.stop();
          }
        }
      }, _callee2, this);
    }));
  
    return function (_x2) {
      return _ref2.apply(this, arguments);
    };
  }());
  //# sourceMappingURL=/Users/crux/Templates/my-babel-mongodb/node_modules/.cache/ava/c97c23b74bb4f0879cb894e733e033a4.js.map