Repository: sequelize/sequelize
File: test/esm-named-exports.test.js (JavaScript)

Code before:
    'GEOMETRY',
    'HSTORE',
    'INET',
    'INTEGER',
    'JSON',
    'JSONB',
    'MACADDR',
    'MACADDR8',
    'MEDIUMINT',
    'NOW',
    'RANGE',
    'REAL',
    'SMALLINT',
    'STRING',
    'TEXT',
    'TIME',
    'TINYINT',
    'TSVECTOR',
    'UUID',
    'UUIDV1',
    'UUIDV4',
    'VIRTUAL',
  ],
  '@sequelize/core/decorators-legacy': ['__esModule'],
  '@sequelize/postgres': ['__esModule'],
  // '@sequelize/snowflake': ['__esModule'],
  '@sequelize/utils': ['__esModule'],
  '@sequelize/utils/node': ['__esModule'],
  '@sequelize/validator.js': ['__esModule'],
};

const exportPaths = Object.keys(ignoredCjsKeysMap);

for (const exportPath of exportPaths) {
  describe(`module "${exportPath}"`, () => {
    it('exposes the same named exports as the CJS module', async () => {
      // important: if you transpile this file, it's important
      //  that we still use both the native import() and the native require().
      //  don't transpile this import() to a require().
      const sequelizeEsm = await import(exportPath);
      const sequelizeCjs = require(exportPath);

      const esmKeys = Object.keys(sequelizeEsm);

      // include non-enumerables as "Sequelize.{and, or, ...}" are non-enumerable
      const cjsKeys = Object.getOwnPropertyNames(sequelizeCjs);

      const ignoredCjsKeys = ignoredCjsKeysMap[exportPath];
      for (const key of ignoredCjsKeys) {
        expect(cjsKeys).to.include(
          key,

Review comment (suggestion):
This is commented out as it returns the following error:
```shell
Error: global leak(s) detected: '__extends', '__assign', '__rest', '__decorate', '__param', '__esDecorate', '__runInitializers', '__propKey', '__setFunctionName', '__metadata', '__awaiter', '__generator', '__exportStar', '__createBinding', '__values', '__read', '__spread', '__spreadArrays', '__spreadArray', '__await', '__asyncGenerator', '__asyncDelegator', '__asyncValues', '__makeTemplateObject', '__importStar', '__importDefault', '__classPrivateFieldGet', '__classPrivateFieldSet', '__classPrivateFieldIn', '__addDisposableResource', '__disposeResources'
```

Code after:
    'GEOMETRY',
    'HSTORE',
    'INET',
    'INTEGER',
    'JSON',
    'JSONB',
    'MACADDR',
    'MACADDR8',
    'MEDIUMINT',
    'NOW',
    'RANGE',
    'REAL',
    'SMALLINT',
    'STRING',
    'TEXT',
    'TIME',
    'TINYINT',
    'TSVECTOR',
    'UUID',
    'UUIDV1',
    'UUIDV4',
    'VIRTUAL',
  ],
  '@sequelize/core/decorators-legacy': ['__esModule'],
  '@sequelize/db2': ['__esModule'],
  '@sequelize/ibmi': ['__esModule'],
  '@sequelize/mariadb': ['__esModule'],
  '@sequelize/mssql': ['__esModule'],
  '@sequelize/mysql': ['__esModule'],
  '@sequelize/postgres': ['__esModule'],
  '@sequelize/snowflake': ['__esModule'],
  '@sequelize/sqlite': ['__esModule'],
  '@sequelize/utils': ['__esModule'],
  '@sequelize/utils/node': ['__esModule'],
  '@sequelize/validator.js': ['__esModule'],
};

const exportPaths = Object.keys(ignoredCjsKeysMap);

for (const exportPath of exportPaths) {
  describe(`module "${exportPath}"`, () => {
    it('exposes the same named exports as the CJS module', async () => {
      // important: if you transpile this file, it's important
      //  that we still use both the native import() and the native require().
      //  don't transpile this import() to a require().
      const sequelizeEsm = await import(exportPath);
      const sequelizeCjs = require(exportPath);

      const esmKeys = Object.keys(sequelizeEsm);

      // include non-enumerables as "Sequelize.{and, or, ...}" are non-enumerable