hunk.code_window: }
   /**
    * These classes are needed for stream operations or
    * in the mongodb driver. both aren't supported in the browser
    */
   export class EventEmitter {}
  
hunk.labels: keep keep keep keep replace keep keep keep
hunk.after_edit:  * in the mongodb driver. Both aren't supported in the browser.
  
hunk.file_path: src/platform/BrowserPlatformTools.template
hunk.type: replace
file: import "reflect-metadata";
  import {Connection} from "../../../../../src/connection/Connection";
  import {closeTestingConnections, createTestingConnections, reloadTestingDatabases} from "../../../../utils/test-utils";
  import {Post} from "./entity/Post";
  import {expect} from "chai";
  
  describe("mongodb > indices", () => {
  
      let connections: Connection[];
      before(async () => connections = await createTestingConnections({
          entities: [Post],
          enabledDrivers: ["mongodb"]
      }));
      beforeEach(() => reloadTestingDatabases(connections));
      after(() => closeTestingConnections(connections));
  
      it("should insert entity with indices correctly", () => Promise.all(connections.map(async connection => {
          const postRepository = connection.getRepository(Post);
  
          // save a post
          const post = new Post();
          post.title = "Post";
          post.name = "About Post";
          await postRepository.save(post);
  
          // check saved post
          const loadedPost = await postRepository.findOne({ title: "Post" });
  
          expect(loadedPost).to.be.not.empty;
      })));
  
  });
  