Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Tests] Migrate mocha tests to jest #215

Closed
mihirsoni opened this issue Mar 22, 2021 · 0 comments · Fixed by #1553
Closed

[Tests] Migrate mocha tests to jest #215

mihirsoni opened this issue Mar 22, 2021 · 0 comments · Fixed by #1553
Assignees
Labels
technical debt If not paid, jeapardizes long-term success and maintainability of the repository. test:unit

Comments

@mihirsoni
Copy link
Contributor

mihirsoni commented Mar 22, 2021

There are few mocha tests which needs to be migrated to Jest.
Following test cases should be converted to jest.

Steps to convert :

  • Move tests out __tests__ directory and append it with test.js / test.ts extension.
  • Ensure tests are passing and are able to run via Jest.
╰─ yarn test:mocha                                                                                                                                                                                                                                         ─╯
yarn run v1.22.10
$ node scripts/mocha


  dev/File
    constructor
      ✓ throws if path is not a string
    #getRelativePath()
      ✓ returns the path relative to the repo root
    #isJs()
      ✓ returns true if extension is .js
      ✓ returns false if extension is .xml
      ✓ returns false if extension is .css
      ✓ returns false if extension is .html
      ✓ returns false if file has no extension
    #getRelativeParentDirs()
      ✓ returns the parents of a file, stopping at the repo root, in descending order
    #toString()
      ✓ returns the relativePath
    #toJSON()
      ✓ returns the relativePath

  All configs should use a single version of Node
    ✓ should compare .node-version and .nvmrc
    ✓ should compare .node-version and engines.node from package.json

  getUrl
    ✓ should convert to a url
    ✓ should convert to a url with port
    ✓ should convert to a secure hashed url

  tasks/lib/licenses
    assertLicensesValid()
      ✓ returns undefined when package has valid license
      ✓ throw an error when the packages license is invalid
      ✓ throws an error when the package has no licenses
      ✓ includes the relative path to packages in error message

  dev/mocha/junit report generation
    ✓ reports on failed setup hooks

  unset(obj, key)
    invalid input
      ✓ should do nothing if not given an object
      ✓ should do nothing if not given a key
      ✓ should do nothing if given an empty string as a key
    shallow removal
      ✓ should remove the param using a string key
      ✓ should remove the param using an array key
    deep removal
      ✓ should remove the param using a string key
      ✓ should remove the param using an array key
    recursive removal
      ✓ should clear object if only value is removed
      ✓ should clear object if no props are left
      ✓ should remove deep property, then clear the object

  plugins/console
    #getOpenSearchProxyConfig
      ✓ sets timeout
      ✓ uses https.Agent when url's protocol is https
      ✓ uses http.Agent when url's protocol is http
      ssl
        ✓ sets rejectUnauthorized to false when verificationMode is none
        ✓ sets rejectUnauthorized to true when verificationMode is certificate
        ✓ sets checkServerIdentity to not check hostname when verificationMode is certificate
        ✓ sets rejectUnauthorized to true when verificationMode is full
        ✓ doesn't set checkServerIdentity when verificationMode is full
        ✓ sets ca when certificateAuthorities are specified
        when alwaysPresentCertificate is false
          ✓ doesn't set cert and key when certificate and key paths are specified
          ✓ doesn't set passphrase when certificate, key and keyPassphrase are specified
        when alwaysPresentCertificate is true
          ✓ sets cert and key when certificate and key are specified
          ✓ sets passphrase when certificate, key and keyPassphrase are specified
          ✓ doesn't set cert when only certificate path is specified
          ✓ doesn't set key when only key path is specified

  ProxyConfig
    constructor
      ✓ uses ca to create sslAgent
      ✓ uses cert, and key to create sslAgent
      ✓ uses ca, cert, and key to create sslAgent
    #getForParsedUri
      parsed url does not match
        ✓ returns {}
      parsed url does match
        ✓ assigns timeout value
        ✓ assigns ssl.verify to rejectUnauthorized
        uri us http
          ca is set
            ✓ creates but does not output the agent
          cert is set
            ✓ creates but does not output the agent
          key is set
            ✓ creates but does not output the agent
          cert + key are set
            ✓ creates but does not output the agent
        uri us https
          ca is set
            ✓ creates and outputs the agent
          cert is set
            ✓ creates and outputs the agent
          key is set
            ✓ creates and outputs the agent
          cert + key are set
            ✓ creates and outputs the agent

  ProxyConfigCollection
    http://localhost:5601
      ✓ defaults to the first matching timeout
    https://localhost:5601/.opensearch_dashboards
      ✓ defaults to the first matching timeout
    http://localhost:5602
      ✓ defaults to the first matching timeout
    https://localhost:5602
      ✓ defaults to the first matching timeout
    http://localhost:5603
      ✓ defaults to the first matching timeout
    https://localhost:5603
      ✓ defaults to the first matching timeout
    https://localhost:5601/index
      ✓ defaults to the first matching timeout
    http://localhost:5601/index
      ✓ defaults to the first matching timeout
    https://localhost:5601/index/type
      ✓ defaults to the first matching timeout
    http://notlocalhost
      ✓ defaults to the first matching timeout
    collection with ssl config and root level verify:false
      ✓ verifies for config that produces ssl agent
      ✓ disabled verification for * config

  #set_headers
    ✓ throws if not given an object as the first argument
    ✓ throws if not given an object as the second argument
    ✓ returns a new object
    ✓ returns object with newHeaders merged with originalHeaders
    ✓ returns object where newHeaders takes precedence for any matching keys

  WildcardMatcher
    pattern = *
      ✓ matches http
      ✓ matches https
      ✓ matches nothing
      ✓ does not match /
      ✓ matches localhost
      ✓ matches a path
      defaultValue = /
        ✓ matches /
    pattern = http
      ✓ matches http
      ✓ does not match https
      ✓ does not match nothing
      ✓ does not match localhost
      ✓ does not match a path
    pattern = 560{1..9}
      ✓ does not match http
      ✓ does not matches 5600
      ✓ matches 5601
      ✓ matches 5602
      ✓ matches 5603
      ✓ matches 5604
      ✓ matches 5605
      ✓ matches 5606
      ✓ matches 5607
      ✓ matches 5608
      ✓ matches 5609
      ✓ does not matches 5610

  dateMath
    errors
      ✓ should return undefined if passed something falsy
      ✓ should return undefined if I pass an operator besides [+-/]
      ✓ should return undefined if I pass a unit besidess,m,h,d,w,M,y,ms
      ✓ should return undefined if rounding unit is not 1
      ✓ should not go into an infinite loop when missing a unit
      forceNow
        ✓ should throw an Error if passed a string
        ✓ should throw an Error if passed a moment
        ✓ should throw an Error if passed an invalid date
    objects and strings
      ✓ should return the same moment if passed a moment
      ✓ should return a moment if passed a date
      ✓ should return a moment if passed an ISO8601 string
      ✓ should return the current time when parsing now
      ✓ should use the forceNow parameter when parsing now
    subtraction
      ✓ should return 5s ago
      ✓ should return 5s before 2014-01-01T06:06:06.666Z
      ✓ should return 5s before forceNow
      ✓ should return 5m ago
      ✓ should return 5m before 2014-01-01T06:06:06.666Z
      ✓ should return 5m before forceNow
      ✓ should return 5h ago
      ✓ should return 5h before 2014-01-01T06:06:06.666Z
      ✓ should return 5h before forceNow
      ✓ should return 5d ago
      ✓ should return 5d before 2014-01-01T06:06:06.666Z
      ✓ should return 5d before forceNow
      ✓ should return 5w ago
      ✓ should return 5w before 2014-01-01T06:06:06.666Z
      ✓ should return 5w before forceNow
      ✓ should return 5M ago
      ✓ should return 5M before 2014-01-01T06:06:06.666Z
      ✓ should return 5M before forceNow
      ✓ should return 5y ago
      ✓ should return 5y before 2014-01-01T06:06:06.666Z
      ✓ should return 5y before forceNow
      ✓ should return 5ms ago
      ✓ should return 5ms before 2014-01-01T06:06:06.666Z
      ✓ should return 5ms before forceNow
      ✓ should return 12s ago
      ✓ should return 12s before 2014-01-01T06:06:06.666Z
      ✓ should return 12s before forceNow
      ✓ should return 12m ago
      ✓ should return 12m before 2014-01-01T06:06:06.666Z
      ✓ should return 12m before forceNow
      ✓ should return 12h ago
      ✓ should return 12h before 2014-01-01T06:06:06.666Z
      ✓ should return 12h before forceNow
      ✓ should return 12d ago
      ✓ should return 12d before 2014-01-01T06:06:06.666Z
      ✓ should return 12d before forceNow
      ✓ should return 12w ago
      ✓ should return 12w before 2014-01-01T06:06:06.666Z
      ✓ should return 12w before forceNow
      ✓ should return 12M ago
      ✓ should return 12M before 2014-01-01T06:06:06.666Z
      ✓ should return 12M before forceNow
      ✓ should return 12y ago
      ✓ should return 12y before 2014-01-01T06:06:06.666Z
      ✓ should return 12y before forceNow
      ✓ should return 12ms ago
      ✓ should return 12ms before 2014-01-01T06:06:06.666Z
      ✓ should return 12ms before forceNow
      ✓ should return 247s ago
      ✓ should return 247s before 2014-01-01T06:06:06.666Z
      ✓ should return 247s before forceNow
      ✓ should return 247m ago
      ✓ should return 247m before 2014-01-01T06:06:06.666Z
      ✓ should return 247m before forceNow
      ✓ should return 247h ago
      ✓ should return 247h before 2014-01-01T06:06:06.666Z
      ✓ should return 247h before forceNow
      ✓ should return 247d ago
      ✓ should return 247d before 2014-01-01T06:06:06.666Z
      ✓ should return 247d before forceNow
      ✓ should return 247w ago
      ✓ should return 247w before 2014-01-01T06:06:06.666Z
      ✓ should return 247w before forceNow
      ✓ should return 247M ago
      ✓ should return 247M before 2014-01-01T06:06:06.666Z
      ✓ should return 247M before forceNow
      ✓ should return 247y ago
      ✓ should return 247y before 2014-01-01T06:06:06.666Z
      ✓ should return 247y before forceNow
      ✓ should return 247ms ago
      ✓ should return 247ms before 2014-01-01T06:06:06.666Z
      ✓ should return 247ms before forceNow
    addition
      ✓ should return 5s from now
      ✓ should return 5s after 2014-01-01T06:06:06.666Z
      ✓ should return 5s after forceNow
      ✓ should return 5m from now
      ✓ should return 5m after 2014-01-01T06:06:06.666Z
      ✓ should return 5m after forceNow
      ✓ should return 5h from now
      ✓ should return 5h after 2014-01-01T06:06:06.666Z
      ✓ should return 5h after forceNow
      ✓ should return 5d from now
      ✓ should return 5d after 2014-01-01T06:06:06.666Z
      ✓ should return 5d after forceNow
      ✓ should return 5w from now
      ✓ should return 5w after 2014-01-01T06:06:06.666Z
      ✓ should return 5w after forceNow
      ✓ should return 5M from now
      ✓ should return 5M after 2014-01-01T06:06:06.666Z
      ✓ should return 5M after forceNow
      ✓ should return 5y from now
      ✓ should return 5y after 2014-01-01T06:06:06.666Z
      ✓ should return 5y after forceNow
      ✓ should return 5ms from now
      ✓ should return 5ms after 2014-01-01T06:06:06.666Z
      ✓ should return 5ms after forceNow
      ✓ should return 12s from now
      ✓ should return 12s after 2014-01-01T06:06:06.666Z
      ✓ should return 12s after forceNow
      ✓ should return 12m from now
      ✓ should return 12m after 2014-01-01T06:06:06.666Z
      ✓ should return 12m after forceNow
      ✓ should return 12h from now
      ✓ should return 12h after 2014-01-01T06:06:06.666Z
      ✓ should return 12h after forceNow
      ✓ should return 12d from now
      ✓ should return 12d after 2014-01-01T06:06:06.666Z
      ✓ should return 12d after forceNow
      ✓ should return 12w from now
      ✓ should return 12w after 2014-01-01T06:06:06.666Z
      ✓ should return 12w after forceNow
      ✓ should return 12M from now
      ✓ should return 12M after 2014-01-01T06:06:06.666Z
      ✓ should return 12M after forceNow
      ✓ should return 12y from now
      ✓ should return 12y after 2014-01-01T06:06:06.666Z
      ✓ should return 12y after forceNow
      ✓ should return 12ms from now
      ✓ should return 12ms after 2014-01-01T06:06:06.666Z
      ✓ should return 12ms after forceNow
      ✓ should return 247s from now
      ✓ should return 247s after 2014-01-01T06:06:06.666Z
      ✓ should return 247s after forceNow
      ✓ should return 247m from now
      ✓ should return 247m after 2014-01-01T06:06:06.666Z
      ✓ should return 247m after forceNow
      ✓ should return 247h from now
      ✓ should return 247h after 2014-01-01T06:06:06.666Z
      ✓ should return 247h after forceNow
      ✓ should return 247d from now
      ✓ should return 247d after 2014-01-01T06:06:06.666Z
      ✓ should return 247d after forceNow
      ✓ should return 247w from now
      ✓ should return 247w after 2014-01-01T06:06:06.666Z
      ✓ should return 247w after forceNow
      ✓ should return 247M from now
      ✓ should return 247M after 2014-01-01T06:06:06.666Z
      ✓ should return 247M after forceNow
      ✓ should return 247y from now
      ✓ should return 247y after 2014-01-01T06:06:06.666Z
      ✓ should return 247y after forceNow
      ✓ should return 247ms from now
      ✓ should return 247ms after 2014-01-01T06:06:06.666Z
      ✓ should return 247ms after forceNow
    rounding
      ✓ should round now to the beginning of the s
      ✓ should round now to the beginning of forceNow's s
      ✓ should round now to the end of the s
      ✓ should round now to the end of forceNow's s
      ✓ should round now to the beginning of the m
      ✓ should round now to the beginning of forceNow's m
      ✓ should round now to the end of the m
      ✓ should round now to the end of forceNow's m
      ✓ should round now to the beginning of the h
      ✓ should round now to the beginning of forceNow's h
      ✓ should round now to the end of the h
      ✓ should round now to the end of forceNow's h
      ✓ should round now to the beginning of the d
      ✓ should round now to the beginning of forceNow's d
      ✓ should round now to the end of the d
      ✓ should round now to the end of forceNow's d
      ✓ should round now to the beginning of the w
      ✓ should round now to the beginning of forceNow's w
      ✓ should round now to the end of the w
      ✓ should round now to the end of forceNow's w
      ✓ should round now to the beginning of the M
      ✓ should round now to the beginning of forceNow's M
      ✓ should round now to the end of the M
      ✓ should round now to the end of forceNow's M
      ✓ should round now to the beginning of the y
      ✓ should round now to the beginning of forceNow's y
      ✓ should round now to the end of the y
      ✓ should round now to the end of forceNow's y
      ✓ should round now to the beginning of the ms
      ✓ should round now to the beginning of forceNow's ms
      ✓ should round now to the end of the ms
      ✓ should round now to the end of forceNow's ms
    math and rounding
      ✓ should round to the nearest second with 0 value
      ✓ should subtract 17s, rounded to the nearest second
      ✓ should add 555ms, rounded to the nearest millisecond
      ✓ should subtract 555ms, rounded to the nearest second
      ✓ should round weeks to Sunday by default
      ✓ should round weeks based on the passed moment locale start of week setting
      ✓ should round up weeks based on the passed moment locale start of week setting
      ✓ should round relative to forceNow
      ✓ should parse long expressions
    used momentjs instance
      ✓ should use the default moment instance if parameter not specified
      ✓ should not use default moment instance if parameter is specified
      ✓ should work with multiple different instances
      ✓ should use global instance after passing an instance
    units
      ✓ should have units descending for unitsDesc
      ✓ should have units ascending for unitsAsc

  testSubjSelector()
    ✓ converts subjectSelectors to cssSelectors

  @osd/eslint/disallow-license-headers
    valid
      ✓ /* license */

console.log('foo')
      ✓ // license

console.log('foo')
    invalid
      ✓ console.log('foo')
      ✓ console.log('foo')
      ✓ console.log('foo')
      ✓ console.log('foo')
      ✓ console.log('foo')

  @osd/eslint/no-restricted-paths
    valid
      ✓ import a from "../client/a.js"
      ✓ const a = require("../client/a.js")
      ✓ import b from "../server/b.js"
      ✓ notrequire("../server/b.js")
      ✓ notrequire("../server/b.js")
      ✓ require("../server/b.js")
      ✓ import b from "../server/b.js"
      ✓ require("os")
      ✓ const d = require("./deep/d.js")
      ✓ const d = require("./deep/d.js")
      ✓ import { X } from "./index_patterns"
    invalid
      ✓ export { b } from "../server/b.js"
      ✓ import b from "../server/b.js"
      ✓ import a from "../client/a"
import c from "./c"
      ✓ const b = require("../server/b.js")
      ✓ const b = require("../server/b.js")
      ✓ const d = require("./deep/d.js")
      ✓ const d = require("src/core/server/saved_objects")
      ✓ const d = require("ui/kfetch")
      ✓ const d = require("ui/kfetch/public/index")
      ✓ import { X } from "./index_patterns"

  @osd/eslint/require-license-header
    valid
      ✓ /* license */

console.log('foo')
      ✓ // license

console.log('foo')
    invalid
      ✓ console.log('foo')
      ✓ console.log('foo')
      ✓ console.log('foo')
      ✓ console.log('foo')
      ✓ console.log('foo')
      ✓ console.log('foo')
      ✓

/* license */

console.log('foo')
      ✓ /* not license */
/* license */
console.log('foo')

  opensearchArchiver: Stats
    #skippedIndex(index)
      ✓ marks the index as skipped
      ✓ logs that the index was skipped
    #deletedIndex(index)
      ✓ marks the index as deleted
      ✓ logs that the index was deleted
    #createdIndex(index, [metadata])
      ✓ marks the index as created
      ✓ logs that the index was created
      with metadata
        ✓ debug-logs each key from the metadata
      without metadata
        ✓ no debug logging
    #archivedIndex(index, [metadata])
      ✓ marks the index as archived
      ✓ logs that the index was archived
      with metadata
        ✓ debug-logs each key from the metadata
      without metadata
        ✓ no debug logging
    #indexedDoc(index)
      ✓ increases the docs.indexed count for the index
    #archivedDoc(index)
      ✓ increases the docs.archived count for the index
    #toJSON()
      ✓ returns the stats for all indexes
      ✓ returns a deep clone of the stats
    #forEachIndex(fn)
      ✓ iterates a clone of the index stats

  opensearchArchiver createFormatArchiveStreams
    { gzip: false }
      ✓ returns an array of streams
      ✓ streams consume js values and produces buffers
      ✓ product is pretty-printed JSON separated by two newlines
    { gzip: true }
      ✓ returns an array of streams
      ✓ streams consume js values and produces buffers
      ✓ output can be gunzipped
    defaults
      ✓ product is not gzipped

  opensearchArchiver createParseArchiveStreams
    { gzip: false }
      ✓ returns an array of streams
      streams
        ✓ consume buffers of valid JSON
        ✓ consume buffers of valid JSON separated by two newlines
        ✓ provides each JSON object as soon as it is parsed
      stream errors
        ✓ stops when any document contains invalid json
    { gzip: true }
      ✓ returns an array of streams
      ✓ parses blank files
      streams
        ✓ consumes gzipped buffers of valid JSON
        ✓ parses valid gzipped JSON strings separated by two newlines
      stream errors
        ✓ stops when the input is not valid gzip archive
    defaults
      ✓ does not try to gunzip the content

  opensearchArchiver: createGenerateDocRecordsStream()
    ✓ scolls 1000 documents at a time
    ✓ uses a 1 minute scroll timeout
    ✓ consumes index names and scrolls completely before continuing

  opensearchArchiver: createIndexDocRecordsStream()
    ✓ consumes doc records and sends to `_bulk` api
    ✓ consumes multiple doc records and sends to `_bulk` api together
    ✓ waits until request is complete before sending more
    ✓ sends a maximum of 300 documents at a time
    ✓ emits an error if any request fails

  opensearchArchiver: createCreateIndexStream()
    defaults
      ✓ deletes existing indices, creates all
      ✓ deletes existing aliases, creates all
      ✓ passes through "hit" records
      ✓ creates aliases
      ✓ passes through records with unknown types
      ✓ passes through non-record values
    skipExisting = true
      ✓ ignores preexisting indexes
      ✓ filters documents for skipped indices

  opensearchArchiver: createDeleteIndexStream()
    ✓ deletes the index without checking if it exists
    ✓ reports the delete when the index existed

  opensearchArchiver: createGenerateIndexRecordsStream()
    ✓ consumes index names and queries for the mapping of each
    ✓ filters index metadata from settings
    ✓ produces one index record for each index name it receives
    ✓ understands aliases

  opensearchArchiver: createFilterRecordsStream()
    ✓ consumes any value
    ✓ produces record values that have a matching type

  basic config file with a single app and test
    ✓ runs and prints expected output

  failure hooks
    ✓ runs and prints expected output

  readConfigFile()
    ✓ reads config from a file, returns an instance of Config class
    ✓ merges setting overrides into log
    ✓ supports loading config files from within config files
    ✓ throws if settings are invalid


  408 passing (6s)

Done in 8.62s.
@mihirsoni mihirsoni added help wanted Community development is encouraged test:unit good first issue Good for newcomers labels Mar 22, 2021
@joshuarrrr joshuarrrr self-assigned this May 4, 2022
@tmarkley tmarkley removed good first issue Good for newcomers help wanted Community development is encouraged labels May 6, 2022
@joshuarrrr joshuarrrr changed the title [Tests] Remove Mocha tests dependency [Tests] Migrate mocha tests to jest May 9, 2022
@tmarkley tmarkley added the technical debt If not paid, jeapardizes long-term success and maintainability of the repository. label May 25, 2022
tmarkley pushed a commit that referenced this issue Jun 6, 2022
- `src/dev`
  - migrate mocha tests to jest
- `src/test_utils`
  - migrate mocha tests to jest
- `src/dev/license_checker`
  - migrate mocha tests to jest
- `src/legacy/utils`
  - migrate mocha tests to jest
  - convert to typescript
  - add unit test for `version.ts`
- `src/plugins/console/server`
  - migrate mocha tests to jest
  - convert to typescript
  - fix type errors
  - improve test cases
  - update URL parsing
- `packages/opensearch-datemath
  - migrate mocha tests to jest
  - convert to typescript
- `packages/osd-eslint-plugin-eslint`
  - migrate mocha tests to jest
  - rename test file directory
- `packages/osd-opensearch-archiver`
  - migrate mocha tests to jest
  - rename stub directory
- `packages/osd-test`
  - migrate mocha tests to jest
  - remove mocha timeouts (not needed in jest)
  - linting fixes
- `packages/osd-test-subject-selector`
  - migrate mocha tests to jest
  - convert to typescript
  - update tsconfig to transpile ts
  - switch to named exports/imports

Verified that 410 of previous 411 mocha test cases are correctly ran by jest.
Mocha: 1 passing test (mocha report generation, which will be removed in #1572)
Jest: 11155 passing tests (11155 = 10741 previous jest tests + 4 newly added jest test + 410 migrated mocha tests)

Resolves #215 

Signed-off-by: Josh Romero <rmerqg@amazon.com>
opensearch-trigger-bot bot pushed a commit that referenced this issue Jun 6, 2022
- `src/dev`
  - migrate mocha tests to jest
- `src/test_utils`
  - migrate mocha tests to jest
- `src/dev/license_checker`
  - migrate mocha tests to jest
- `src/legacy/utils`
  - migrate mocha tests to jest
  - convert to typescript
  - add unit test for `version.ts`
- `src/plugins/console/server`
  - migrate mocha tests to jest
  - convert to typescript
  - fix type errors
  - improve test cases
  - update URL parsing
- `packages/opensearch-datemath
  - migrate mocha tests to jest
  - convert to typescript
- `packages/osd-eslint-plugin-eslint`
  - migrate mocha tests to jest
  - rename test file directory
- `packages/osd-opensearch-archiver`
  - migrate mocha tests to jest
  - rename stub directory
- `packages/osd-test`
  - migrate mocha tests to jest
  - remove mocha timeouts (not needed in jest)
  - linting fixes
- `packages/osd-test-subject-selector`
  - migrate mocha tests to jest
  - convert to typescript
  - update tsconfig to transpile ts
  - switch to named exports/imports

Verified that 410 of previous 411 mocha test cases are correctly ran by jest.
Mocha: 1 passing test (mocha report generation, which will be removed in #1572)
Jest: 11155 passing tests (11155 = 10741 previous jest tests + 4 newly added jest test + 410 migrated mocha tests)

Resolves #215

Signed-off-by: Josh Romero <rmerqg@amazon.com>
(cherry picked from commit 0e41477)
tmarkley pushed a commit that referenced this issue Jun 7, 2022
- `src/dev`
  - migrate mocha tests to jest
- `src/test_utils`
  - migrate mocha tests to jest
- `src/dev/license_checker`
  - migrate mocha tests to jest
- `src/legacy/utils`
  - migrate mocha tests to jest
  - convert to typescript
  - add unit test for `version.ts`
- `src/plugins/console/server`
  - migrate mocha tests to jest
  - convert to typescript
  - fix type errors
  - improve test cases
  - update URL parsing
- `packages/opensearch-datemath
  - migrate mocha tests to jest
  - convert to typescript
- `packages/osd-eslint-plugin-eslint`
  - migrate mocha tests to jest
  - rename test file directory
- `packages/osd-opensearch-archiver`
  - migrate mocha tests to jest
  - rename stub directory
- `packages/osd-test`
  - migrate mocha tests to jest
  - remove mocha timeouts (not needed in jest)
  - linting fixes
- `packages/osd-test-subject-selector`
  - migrate mocha tests to jest
  - convert to typescript
  - update tsconfig to transpile ts
  - switch to named exports/imports

Verified that 410 of previous 411 mocha test cases are correctly ran by jest.
Mocha: 1 passing test (mocha report generation, which will be removed in #1572)
Jest: 11155 passing tests (11155 = 10741 previous jest tests + 4 newly added jest test + 410 migrated mocha tests)

Resolves #215

Signed-off-by: Josh Romero <rmerqg@amazon.com>
(cherry picked from commit 0e41477)
kavilla pushed a commit to kavilla/OpenSearch-Dashboards-1 that referenced this issue Jun 8, 2022
- `src/dev`
  - migrate mocha tests to jest
- `src/test_utils`
  - migrate mocha tests to jest
- `src/dev/license_checker`
  - migrate mocha tests to jest
- `src/legacy/utils`
  - migrate mocha tests to jest
  - convert to typescript
  - add unit test for `version.ts`
- `src/plugins/console/server`
  - migrate mocha tests to jest
  - convert to typescript
  - fix type errors
  - improve test cases
  - update URL parsing
- `packages/opensearch-datemath
  - migrate mocha tests to jest
  - convert to typescript
- `packages/osd-eslint-plugin-eslint`
  - migrate mocha tests to jest
  - rename test file directory
- `packages/osd-opensearch-archiver`
  - migrate mocha tests to jest
  - rename stub directory
- `packages/osd-test`
  - migrate mocha tests to jest
  - remove mocha timeouts (not needed in jest)
  - linting fixes
- `packages/osd-test-subject-selector`
  - migrate mocha tests to jest
  - convert to typescript
  - update tsconfig to transpile ts
  - switch to named exports/imports

Verified that 410 of previous 411 mocha test cases are correctly ran by jest.
Mocha: 1 passing test (mocha report generation, which will be removed in opensearch-project#1572)
Jest: 11155 passing tests (11155 = 10741 previous jest tests + 4 newly added jest test + 410 migrated mocha tests)

Resolves opensearch-project#215 

Signed-off-by: Josh Romero <rmerqg@amazon.com>
kavilla pushed a commit to kavilla/OpenSearch-Dashboards-1 that referenced this issue Jun 8, 2022
- `src/dev`
  - migrate mocha tests to jest
- `src/test_utils`
  - migrate mocha tests to jest
- `src/dev/license_checker`
  - migrate mocha tests to jest
- `src/legacy/utils`
  - migrate mocha tests to jest
  - convert to typescript
  - add unit test for `version.ts`
- `src/plugins/console/server`
  - migrate mocha tests to jest
  - convert to typescript
  - fix type errors
  - improve test cases
  - update URL parsing
- `packages/opensearch-datemath
  - migrate mocha tests to jest
  - convert to typescript
- `packages/osd-eslint-plugin-eslint`
  - migrate mocha tests to jest
  - rename test file directory
- `packages/osd-opensearch-archiver`
  - migrate mocha tests to jest
  - rename stub directory
- `packages/osd-test`
  - migrate mocha tests to jest
  - remove mocha timeouts (not needed in jest)
  - linting fixes
- `packages/osd-test-subject-selector`
  - migrate mocha tests to jest
  - convert to typescript
  - update tsconfig to transpile ts
  - switch to named exports/imports

Verified that 410 of previous 411 mocha test cases are correctly ran by jest.
Mocha: 1 passing test (mocha report generation, which will be removed in opensearch-project#1572)
Jest: 11155 passing tests (11155 = 10741 previous jest tests + 4 newly added jest test + 410 migrated mocha tests)

Resolves opensearch-project#215 

Signed-off-by: Josh Romero <rmerqg@amazon.com>
kavilla pushed a commit to kavilla/OpenSearch-Dashboards-1 that referenced this issue Jun 16, 2022
- `src/dev`
  - migrate mocha tests to jest
- `src/test_utils`
  - migrate mocha tests to jest
- `src/dev/license_checker`
  - migrate mocha tests to jest
- `src/legacy/utils`
  - migrate mocha tests to jest
  - convert to typescript
  - add unit test for `version.ts`
- `src/plugins/console/server`
  - migrate mocha tests to jest
  - convert to typescript
  - fix type errors
  - improve test cases
  - update URL parsing
- `packages/opensearch-datemath
  - migrate mocha tests to jest
  - convert to typescript
- `packages/osd-eslint-plugin-eslint`
  - migrate mocha tests to jest
  - rename test file directory
- `packages/osd-opensearch-archiver`
  - migrate mocha tests to jest
  - rename stub directory
- `packages/osd-test`
  - migrate mocha tests to jest
  - remove mocha timeouts (not needed in jest)
  - linting fixes
- `packages/osd-test-subject-selector`
  - migrate mocha tests to jest
  - convert to typescript
  - update tsconfig to transpile ts
  - switch to named exports/imports

Verified that 410 of previous 411 mocha test cases are correctly ran by jest.
Mocha: 1 passing test (mocha report generation, which will be removed in opensearch-project#1572)
Jest: 11155 passing tests (11155 = 10741 previous jest tests + 4 newly added jest test + 410 migrated mocha tests)

Resolves opensearch-project#215 

Signed-off-by: Josh Romero <rmerqg@amazon.com>
cliu123 pushed a commit to cliu123/OpenSearch-Dashboards that referenced this issue Jun 30, 2022
…arch-project#1678)

- `src/dev`
  - migrate mocha tests to jest
- `src/test_utils`
  - migrate mocha tests to jest
- `src/dev/license_checker`
  - migrate mocha tests to jest
- `src/legacy/utils`
  - migrate mocha tests to jest
  - convert to typescript
  - add unit test for `version.ts`
- `src/plugins/console/server`
  - migrate mocha tests to jest
  - convert to typescript
  - fix type errors
  - improve test cases
  - update URL parsing
- `packages/opensearch-datemath
  - migrate mocha tests to jest
  - convert to typescript
- `packages/osd-eslint-plugin-eslint`
  - migrate mocha tests to jest
  - rename test file directory
- `packages/osd-opensearch-archiver`
  - migrate mocha tests to jest
  - rename stub directory
- `packages/osd-test`
  - migrate mocha tests to jest
  - remove mocha timeouts (not needed in jest)
  - linting fixes
- `packages/osd-test-subject-selector`
  - migrate mocha tests to jest
  - convert to typescript
  - update tsconfig to transpile ts
  - switch to named exports/imports

Verified that 410 of previous 411 mocha test cases are correctly ran by jest.
Mocha: 1 passing test (mocha report generation, which will be removed in opensearch-project#1572)
Jest: 11155 passing tests (11155 = 10741 previous jest tests + 4 newly added jest test + 410 migrated mocha tests)

Resolves opensearch-project#215

Signed-off-by: Josh Romero <rmerqg@amazon.com>
(cherry picked from commit 0e41477)
cliu123 pushed a commit to cliu123/OpenSearch-Dashboards that referenced this issue Jun 30, 2022
…arch-project#1678)

- `src/dev`
  - migrate mocha tests to jest
- `src/test_utils`
  - migrate mocha tests to jest
- `src/dev/license_checker`
  - migrate mocha tests to jest
- `src/legacy/utils`
  - migrate mocha tests to jest
  - convert to typescript
  - add unit test for `version.ts`
- `src/plugins/console/server`
  - migrate mocha tests to jest
  - convert to typescript
  - fix type errors
  - improve test cases
  - update URL parsing
- `packages/opensearch-datemath
  - migrate mocha tests to jest
  - convert to typescript
- `packages/osd-eslint-plugin-eslint`
  - migrate mocha tests to jest
  - rename test file directory
- `packages/osd-opensearch-archiver`
  - migrate mocha tests to jest
  - rename stub directory
- `packages/osd-test`
  - migrate mocha tests to jest
  - remove mocha timeouts (not needed in jest)
  - linting fixes
- `packages/osd-test-subject-selector`
  - migrate mocha tests to jest
  - convert to typescript
  - update tsconfig to transpile ts
  - switch to named exports/imports

Verified that 410 of previous 411 mocha test cases are correctly ran by jest.
Mocha: 1 passing test (mocha report generation, which will be removed in opensearch-project#1572)
Jest: 11155 passing tests (11155 = 10741 previous jest tests + 4 newly added jest test + 410 migrated mocha tests)

Resolves opensearch-project#215

Signed-off-by: Josh Romero <rmerqg@amazon.com>
(cherry picked from commit 0e41477)
pjfitzgibbons pushed a commit to pjfitzgibbons/OpenSearch-Dashboards that referenced this issue Aug 10, 2022
- `src/dev`
  - migrate mocha tests to jest
- `src/test_utils`
  - migrate mocha tests to jest
- `src/dev/license_checker`
  - migrate mocha tests to jest
- `src/legacy/utils`
  - migrate mocha tests to jest
  - convert to typescript
  - add unit test for `version.ts`
- `src/plugins/console/server`
  - migrate mocha tests to jest
  - convert to typescript
  - fix type errors
  - improve test cases
  - update URL parsing
- `packages/opensearch-datemath
  - migrate mocha tests to jest
  - convert to typescript
- `packages/osd-eslint-plugin-eslint`
  - migrate mocha tests to jest
  - rename test file directory
- `packages/osd-opensearch-archiver`
  - migrate mocha tests to jest
  - rename stub directory
- `packages/osd-test`
  - migrate mocha tests to jest
  - remove mocha timeouts (not needed in jest)
  - linting fixes
- `packages/osd-test-subject-selector`
  - migrate mocha tests to jest
  - convert to typescript
  - update tsconfig to transpile ts
  - switch to named exports/imports

Verified that 410 of previous 411 mocha test cases are correctly ran by jest.
Mocha: 1 passing test (mocha report generation, which will be removed in opensearch-project#1572)
Jest: 11155 passing tests (11155 = 10741 previous jest tests + 4 newly added jest test + 410 migrated mocha tests)

Resolves opensearch-project#215 

Signed-off-by: Josh Romero <rmerqg@amazon.com>
ananzh added a commit to ananzh/OpenSearch-Dashboards that referenced this issue Nov 1, 2022
In our current repo, most mocha tests have been changed
to jest in this issue:
opensearch-project#215

The fix for the above issue
(mochajs/mocha@61b4b92)
is only released in the latest version v10.1.0:
https://github.com/mochajs/mocha/blob/5f96d511dbf913f135b92198aab721a27f6b44fe/lib/utils.js#L79

Though it is a bump from 7.2.0 to 10.1.0, I don't see breaking
changes for plugins or users.

Signed-off-by: Anan Zhuang <ananzh@amazon.com>
ananzh added a commit to ananzh/OpenSearch-Dashboards that referenced this issue Nov 1, 2022
In our current repo, most mocha tests have been changed
to jest in this issue:
opensearch-project#215

The fix for the above issue
(mochajs/mocha@61b4b92)
is only released in the latest version v10.1.0:
https://github.com/mochajs/mocha/blob/5f96d511dbf913f135b92198aab721a27f6b44fe/lib/utils.js#L79

Though it is a bump from 7.2.0 to 10.1.0, I don't see breaking
changes for plugins or users.

Issue Resolved:
opensearch-project#2269

Signed-off-by: Anan Zhuang <ananzh@amazon.com>
ananzh added a commit to ananzh/OpenSearch-Dashboards that referenced this issue Nov 1, 2022
In our current repo, most mocha tests have been changed
to jest in this issue:
opensearch-project#215

The fix for the above issue
(mochajs/mocha@61b4b92)
is only released in the latest version v10.1.0:
https://github.com/mochajs/mocha/blob/5f96d511dbf913f135b92198aab721a27f6b44fe/lib/utils.js#L79

Though it is a bump from 7.2.0 to 10.1.0, I don't see breaking
changes for plugins or users.

Issue Resolved:
opensearch-project#2269

Signed-off-by: Anan Zhuang <ananzh@amazon.com>
joshuarrrr pushed a commit that referenced this issue Nov 21, 2022
* [WS-2021-0638][Security] bump mocha to 10.1.0

In our current repo, most mocha tests have been changed
to jest in this issue:
#215

The fix for the above issue
(mochajs/mocha@61b4b92)
is only released in the latest version v10.1.0:
https://github.com/mochajs/mocha/blob/5f96d511dbf913f135b92198aab721a27f6b44fe/lib/utils.js#L79

Since we are considering this change might break others, we will not backport to 2.x and release it in 3.0.0

Issue Resolved:
#2269

Signed-off-by: Anan Zhuang <ananzh@amazon.com>
AlexRuiz7 pushed a commit to wazuh/wazuh-dashboard that referenced this issue Dec 14, 2022
* [WS-2021-0638][Security] bump mocha to 10.1.0

In our current repo, most mocha tests have been changed
to jest in this issue:
opensearch-project#215

The fix for the above issue
(mochajs/mocha@61b4b92)
is only released in the latest version v10.1.0:
https://github.com/mochajs/mocha/blob/5f96d511dbf913f135b92198aab721a27f6b44fe/lib/utils.js#L79

Since we are considering this change might break others, we will not backport to 2.x and release it in 3.0.0

Issue Resolved:
opensearch-project#2269

Signed-off-by: Anan Zhuang <ananzh@amazon.com>
AlexRuiz7 pushed a commit to wazuh/wazuh-dashboard that referenced this issue Dec 14, 2022
* [WS-2021-0638][Security] bump mocha to 10.1.0

In our current repo, most mocha tests have been changed
to jest in this issue:
opensearch-project#215

The fix for the above issue
(mochajs/mocha@61b4b92)
is only released in the latest version v10.1.0:
https://github.com/mochajs/mocha/blob/5f96d511dbf913f135b92198aab721a27f6b44fe/lib/utils.js#L79

Since we are considering this change might break others, we will not backport to 2.x and release it in 3.0.0

Issue Resolved:
opensearch-project#2269

Signed-off-by: Anan Zhuang <ananzh@amazon.com>
sipopo pushed a commit to sipopo/OpenSearch-Dashboards that referenced this issue Dec 16, 2022
* [WS-2021-0638][Security] bump mocha to 10.1.0

In our current repo, most mocha tests have been changed
to jest in this issue:
opensearch-project#215

The fix for the above issue
(mochajs/mocha@61b4b92)
is only released in the latest version v10.1.0:
https://github.com/mochajs/mocha/blob/5f96d511dbf913f135b92198aab721a27f6b44fe/lib/utils.js#L79

Since we are considering this change might break others, we will not backport to 2.x and release it in 3.0.0

Issue Resolved:
opensearch-project#2269

Signed-off-by: Anan Zhuang <ananzh@amazon.com>
Signed-off-by: Sergey Osipov <sipopo@yandex.ru>
Arpit-Bandejiya pushed a commit to Arpit-Bandejiya/OpenSearch-Dashboards that referenced this issue Jan 13, 2023
* [WS-2021-0638][Security] bump mocha to 10.1.0

In our current repo, most mocha tests have been changed
to jest in this issue:
opensearch-project#215

The fix for the above issue
(mochajs/mocha@61b4b92)
is only released in the latest version v10.1.0:
https://github.com/mochajs/mocha/blob/5f96d511dbf913f135b92198aab721a27f6b44fe/lib/utils.js#L79

Since we are considering this change might break others, we will not backport to 2.x and release it in 3.0.0

Issue Resolved:
opensearch-project#2269

Signed-off-by: Anan Zhuang <ananzh@amazon.com>
Signed-off-by: Arpit Bandejiya <abandeji@amazon.com>
sikhote pushed a commit to sikhote/OpenSearch-Dashboards that referenced this issue Apr 24, 2023
* [WS-2021-0638][Security] bump mocha to 10.1.0

In our current repo, most mocha tests have been changed
to jest in this issue:
opensearch-project#215

The fix for the above issue
(mochajs/mocha@61b4b92)
is only released in the latest version v10.1.0:
https://github.com/mochajs/mocha/blob/5f96d511dbf913f135b92198aab721a27f6b44fe/lib/utils.js#L79

Since we are considering this change might break others, we will not backport to 2.x and release it in 3.0.0

Issue Resolved:
opensearch-project#2269

Signed-off-by: Anan Zhuang <ananzh@amazon.com>
Signed-off-by: David Sinclair <david@sinclair.tech>
sikhote pushed a commit to sikhote/OpenSearch-Dashboards that referenced this issue Apr 24, 2023
* [WS-2021-0638][Security] bump mocha to 10.1.0

In our current repo, most mocha tests have been changed
to jest in this issue:
opensearch-project#215

The fix for the above issue
(mochajs/mocha@61b4b92)
is only released in the latest version v10.1.0:
https://github.com/mochajs/mocha/blob/5f96d511dbf913f135b92198aab721a27f6b44fe/lib/utils.js#L79

Since we are considering this change might break others, we will not backport to 2.x and release it in 3.0.0

Issue Resolved:
opensearch-project#2269

Signed-off-by: Anan Zhuang <ananzh@amazon.com>
Signed-off-by: David Sinclair <david@sinclair.tech>
SuZhou-Joe pushed a commit to SuZhou-Joe/OpenSearch-Dashboards that referenced this issue Oct 11, 2023
…pensearch-project#215)

Update test description per comment

Signed-off-by: Yulong Ruan <ruanyl@amazon.com>
Co-authored-by: Miki <amoo_miki@yahoo.com>
SuZhou-Joe pushed a commit to SuZhou-Joe/OpenSearch-Dashboards that referenced this issue Oct 11, 2023
…pensearch-project#215)

Update test description per comment

Signed-off-by: Yulong Ruan <ruanyl@amazon.com>
Co-authored-by: Miki <amoo_miki@yahoo.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
technical debt If not paid, jeapardizes long-term success and maintainability of the repository. test:unit
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants