text: "use strict";
  var _this = this;
  Object.defineProperty(exports, "__esModule", { value: true });
  var tslib_1 = require("tslib");
  require("reflect-metadata");
  var test_utils_1 = require("../../utils/test-utils");
  var Post_1 = require("./entity/Post");
  describe("github issues > #3256 wrong subscriber methods being called", function () {
      var connections;
      before(function () { return tslib_1.__awaiter(_this, void 0, void 0, function () {
          return tslib_1.__generator(this, function (_a) {
              switch (_a.label) {
                  case 0: return [4 /*yield*/, test_utils_1.createTestingConnections({
                          entities: [__dirname + "/entity/*{.js,.ts}"],
                          subscribers: [__dirname + "/subscriber/*{.js,.ts}"],
                      })];
                  case 1: return [2 /*return*/, connections = _a.sent()];
              }
          });
      }); });
      beforeEach(function () { return test_utils_1.reloadTestingDatabases(connections); });
      after(function () { return test_utils_1.closeTestingConnections(connections); });
      it("if entity was changed, subscriber should be take updated columns", function () { return Promise.all(connections.map(function (connection) {
          return tslib_1.__awaiter(this, void 0, void 0, function () {
              var post, loadedPost;
              return tslib_1.__generator(this, function (_a) {
                  switch (_a.label) {
                      case 0:
                          post = new Post_1.Post();
                          post.id = 1;
                          post.title = "hello world";
                          return [4 /*yield*/, connection.manager.save(post)];
                      case 1:
                          _a.sent();
                          post.inserted.should.be.equal(true);
                          post.updated.should.be.equal(false);
                          return [4 /*yield*/, connection.getRepository(Post_1.Post).findOne(1)];
                      case 2:
                          loadedPost = _a.sent();
                          loadedPost.title = "updated world";
                          return [4 /*yield*/, connection.manager.save(loadedPost)];
                      case 3:
                          _a.sent();
                          loadedPost.inserted.should.be.equal(false);
                          loadedPost.updated.should.be.equal(true);
                          return [2 /*return*/];
                  }
              });
          });
      })); });
  });
  //# sourceMappingURL=issue-3256.js.map