<commit_before>import { Test } from '@base/types'
import { describe } from '@base/describe'
import { given } from '@base/given'
import { it } from '@base/it'
import { join } from 'path'
import { resolveAliases } from './resolveAliases'
import { tempDir } from './tempDir'

export const test: Test = describe(`resolveAliases`, [
  given(`[ "src/it.test.ts" ], { "@base/*": [ "./src/*" ] }, current working directory`, [
    it(`returns [ [ "@base", "/path/to/temp-dir" ]`, ({ equal }) => {
      const fileNames = ['src/it.test.ts']
      const paths = {
        '@base/*': ['./src/*'],
      }
      const baseUrl = process.cwd()

      const [[aliasName, path]] = resolveAliases(fileNames, paths, baseUrl)

      equal('@base', aliasName)
      equal(join(baseUrl, tempDir.name), path)
    }),
  ]),

  given(`[ "src/it.test.ts" ], {}, current working directory`, [
    it(`returns []`, ({ equal }) => {
      const fileNames = ['src/it.test.ts']
      const paths = {}
      const baseUrl = process.cwd()

      equal([], resolveAliases(fileNames, paths, baseUrl))
    }),
  ]),

  given(`[ "src/it.test.ts" ], { "@base/*": [ "./src/*" ] }, ""`, [
    it(`returns []`, ({ equal }) => {
      const fileNames = ['src/it.test.ts']
      const paths = {
        '@base/*': ['./src/*'],
      }
      const baseUrl = ""

      equal([], resolveAliases(fileNames, paths, baseUrl))
    }),
  ]),

  given(`[ "src/it.test.ts" ], { "@base/*": [ "*" ] }, source directory`, [
    it(`returns [ [ "@base", "/path/to/temp-dir" ]`, ({ equal }) => {
      const cwd = process.cwd()
      const fileNames = [join(cwd, 'src/it.test.ts')]
      const paths = {<commit_msg>style: prettier<commit_after>import { Test } from '@base/types'
import { describe } from '@base/describe'
import { given } from '@base/given'
import { it } from '@base/it'
import { join } from 'path'
import { resolveAliases } from './resolveAliases'
import { tempDir } from './tempDir'

export const test: Test = describe(`resolveAliases`, [
  given(`[ "src/it.test.ts" ], { "@base/*": [ "./src/*" ] }, current working directory`, [
    it(`returns [ [ "@base", "/path/to/temp-dir" ]`, ({ equal }) => {
      const fileNames = ['src/it.test.ts']
      const paths = {
        '@base/*': ['./src/*'],
      }
      const baseUrl = process.cwd()

      const [[aliasName, path]] = resolveAliases(fileNames, paths, baseUrl)

      equal('@base', aliasName)
      equal(join(baseUrl, tempDir.name), path)
    }),
  ]),

  given(`[ "src/it.test.ts" ], {}, current working directory`, [
    it(`returns []`, ({ equal }) => {
      const fileNames = ['src/it.test.ts']
      const paths = {}
      const baseUrl = process.cwd()

      equal([], resolveAliases(fileNames, paths, baseUrl))
    }),
  ]),

  given(`[ "src/it.test.ts" ], { "@base/*": [ "./src/*" ] }, ""`, [
    it(`returns []`, ({ equal }) => {
      const fileNames = ['src/it.test.ts']
      const paths = {
        '@base/*': ['./src/*'],
      }
      const baseUrl = ''

      equal([], resolveAliases(fileNames, paths, baseUrl))
    }),
  ]),

  given(`[ "src/it.test.ts" ], { "@base/*": [ "*" ] }, source directory`, [
    it(`returns [ [ "@base", "/path/to/temp-dir" ]`, ({ equal }) => {
      const cwd = process.cwd()
      const fileNames = [join(cwd, 'src/it.test.ts')]
      const paths = {
{'fraction_non_alphanumeric': 0.22875226039783003, 'fraction_numerical': 0.0, 'mean_word_length': 2.67960088691796, 'pattern_counts': {'":': 6, '<': 3, '<?xml version=': 0, '>': 11, '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': '5605067', 'n_tokens_mistral': 1121, 'n_tokens_neox': 1104, 'n_words': 243}