You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
rsvp-reader/spec/findSentences.spec.js

23 lines
634 B
JavaScript

import {
findSentences
} from '../src/textProcessing/findSentences.js'
describe('findSentences', function () {
it('returns an array', function () {
expect(Array.isArray(findSentences(['Hello', 'World']))).toBeTruthy()
})
it('finds a single sentence', function () {
let sentences = findSentences(['Hello'], ['World'])
expect(sentences.length).toBe(1)
expect(sentences[0]).toBe(0)
})
it('finds two sentences', function () {
let sentences = findSentences(['Hello', 'World.', 'Foo', 'bar.'])
expect(sentences.length).toBe(2)
expect(sentences[0]).toBe(0)
expect(sentences[1]).toBe(2)
})
})