<commit_before>/* eslint-disable */
import { describe, it } from 'mocha'
import { expect } from 'chai'
import VConnect from '../../dist/index'

// get connection details from the env
const vcenter = process.env.VCONNECT_VCENTER
const user = process.env.VCONNECT_USER
const pass = process.env.VCONNECT_PASSWORD
const ignoreSSL = Boolean(process.env.VCONNECT_IGNORE_SSL)
const v = VConnect(vcenter, { ignoreSSL })

describe('retrieve tests', function () {
  it('gets all vms', function () {
    this.timeout(30000) // timeout for uncached connections

    return v.login(user, pass)
      .type('vm')
      .then(vms => {
        expect(Array.isArray(vms)).to.equal(true)
      })
      .catch(error => {
        v.logout()
        return Promise.reject(error)
      })
      .finally(() => {
        return v.logout()
      })
  })

  it('limits selection results', function () {
    this.timeout(30000)
    const limit = 2
    return v.login(user, pass)
      .type('vm')
      .limit(limit)
      .then(vms => {
        expect(Array.isArray(vms)).to.equal(true)
        expect(vms.length).to.equal(limit)
      })
      .catch(error => {
        v.logout()
        return Promise.reject(error)
      })
      .finally(() => {
        return v.logout()
      })
  })

  it('selects the name of a vm', function () {
    this.timeout(30000)
    return v.login(user, pass)
      .type('vm')
      .limit(1)
      .nth(0)('name')
      .then(name => {
        expect(typeof name === 'string').to.equal(true)
      })
      .catch(error => {
        v.logout()
        return Promise.reject(error)
      })
      .finally(() => {
        return v.logout()
      })
  })
})
<commit_msg>adding test for root folder get<commit_after>/* eslint-disable */
import { describe, it } from 'mocha'
import { expect } from 'chai'
import VConnect from '../../dist/index'

// get connection details from the env
const vcenter = process.env.VCONNECT_VCENTER
const user = process.env.VCONNECT_USER
const pass = process.env.VCONNECT_PASSWORD
const ignoreSSL = Boolean(process.env.VCONNECT_IGNORE_SSL)
const v = VConnect(vcenter, { ignoreSSL })

describe('retrieve tests', function () {
  it('gets all vms', function () {
    this.timeout(30000) // timeout for uncached connections

    return v.login(user, pass)
      .type('vm')
      .then(vms => {
        expect(Array.isArray(vms)).to.equal(true)
      })
      .catch(error => {
        v.logout()
        return Promise.reject(error)
      })
      .finally(() => {
        return v.logout()
      })
  })

  it('limits selection results', function () {
    this.timeout(30000)
    const limit = 2
    return v.login(user, pass)
      .type('vm')
      .limit(limit)
      .then(vms => {
        expect(Array.isArray(vms)).to.equal(true)
        expect(vms.length).to.equal(limit)
      })
      .catch(error => {
        v.logout()
        return Promise.reject(error)
      })
      .finally(() => {
        return v.logout()
      })
  })

  it('selects the name of a vm', function () {
    this.timeout(30000)
    return v.login(user, pass)
      .type('vm')
      .limit(1)
      .nth(0)('name')
      .then(name => {
        expect(typeof name === 'string').to.equal(true)
      })
      .catch(error => {
        v.logout()
        return Promise.reject(error)
      })
      .finally(() => {
        return v.logout()
      })
  })

  it('gets the child entity of the root folder', function () {
    this.timeout(30000)

    return v.login(user, pass)
    .type('folder')
    .get(v._rb.client.serviceContent.rootFolder.value)
    .pluck('childEntity')('childEntity')
    .then(result => {
      expect(result).to.not.equal(undefined)
    })
    .catch(error => {
      v.logout()
      return Promise.reject(error)
    })
    .finally(() => {
      return v.logout()
    })
  })
})

{'fraction_non_alphanumeric': 0.16021955044432828, 'fraction_numerical': 0.010716152639832723, 'mean_word_length': 2.2487266553480474, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 24, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5262091', 'n_tokens_mistral': 1280, 'n_tokens_neox': 1256, 'n_words': 250}