Add multiline spec

This commit is contained in:
Wliu
2017-08-09 23:15:33 -04:00
parent 2fa2feacaf
commit 95b216f234

View File

@@ -2394,6 +2394,22 @@ i = /test/; #FIXME\
expect(results[0].replacements).toBe(6)
})
})
it('uses the multiline flag when searching', () => {
const filePath = path.join(projectDir, 'sample.js')
fs.copyFileSync(path.join(fixturesDir, 'sample.js'), filePath)
const results = []
waitsForPromise(() =>
atom.workspace.replace(/;$/gi, 'items', [filePath], result => results.push(result))
)
runs(() => {
expect(results).toHaveLength(1)
expect(results[0].filePath).toBe(filePath)
expect(results[0].replacements).toBe(8)
})
})
})
describe('when a buffer is already open', () => {