"use strict"; /* * @adonisjs/lucid * * (c) Harminder Virk * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ Object.defineProperty(exports, "__esModule", { value: true }); exports.defineTestUtils = void 0; const Seeder_1 = require("../TestUtils/Seeder"); const Migration_1 = require("../TestUtils/Migration"); const Truncator_1 = require("../TestUtils/Truncator"); /** * Define database testing utilities */ function defineTestUtils(testUtils, ace) { testUtils.constructor.macro('db', (connectionName) => { return { migrate() { return new Migration_1.TestsMigrator(ace, connectionName).run(); }, seed() { return new Seeder_1.TestsSeeder(ace, connectionName).run(); }, truncate() { return new Truncator_1.TestsTruncator(ace, connectionName).run(); }, }; }); } exports.defineTestUtils = defineTestUtils;