Skip to content

Commit

Permalink
test(sanity): move tests to src/
Browse files Browse the repository at this point in the history
  • Loading branch information
mariuslundgard committed Oct 4, 2022
1 parent 91dd6e1 commit 3e9e685
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {removeMissingReferences} from '../src/datastores/history/createHistoryStore'
import {removeMissingReferences} from './createHistoryStore'

const testDoc = {
_id: 'foo',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ import {of, Observable, asyncScheduler} from 'rxjs'
import React from 'react'
import ReactDOM from 'react-dom'
import {act} from 'react-dom/test-utils'
import basePkg from '../package.json'
import {checkModuleStatus, useModuleStatus, VersionsResponse} from '../src/module-status'
import basePkg from '../../package.json'
import {checkModuleStatus} from './moduleStatus'
import {useModuleStatus} from './hooks'
import {VersionsResponse} from './types'

const defaults = {isSupported: true, isUpToDate: true, outdated: []}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {tokenize} from '../src/search/common/tokenize'
import {tokenize} from './tokenize'

const tests = [
{input: '', expected: []},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {calculateScore} from '../src/search/weighted/applyWeights'
import {calculateScore} from './weighted/applyWeights'

test('Exact match', () => {
expect(calculateScore(['foo'], 'foo')).toEqual([1, 'Exact match'])
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {SanityDocument} from '@sanity/types'
import {collate, removeDupes} from '../src/util/draftUtils'
import {collate, removeDupes} from './draftUtils'

test('collate()', () => {
const foo = {_type: 'foo', _id: 'foo'}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {fieldNeedsEscape, escapeField, joinPath} from '../src/util/searchUtils'
import {escapeField, fieldNeedsEscape, joinPath} from './searchUtils'

test('fieldNeedsEscape', () => {
expect(fieldNeedsEscape('0foo')).toBe(true)
Expand Down

0 comments on commit 3e9e685

Please sign in to comment.