mirror of
https://github.com/cypress-io/cypress.git
synced 2026-04-29 03:09:53 -05:00
e4442ab7ac
* refactor: remove global.root & use in requires * fix types
27 lines
614 B
JavaScript
27 lines
614 B
JavaScript
require('../../spec_helper')
|
|
|
|
const CacheBuster = require(`../../../lib/util/cache_buster`)
|
|
|
|
describe('lib/cache_buster', () => {
|
|
context('#get', () => {
|
|
it('returns seperator + 3 characters', () => {
|
|
expect(CacheBuster.get().length).to.eq(4)
|
|
})
|
|
})
|
|
|
|
context('#strip', () => {
|
|
it('strips cache buster', () => {
|
|
const rand = CacheBuster.get()
|
|
const file = `foo.js${rand}`
|
|
|
|
expect(CacheBuster.strip(file)).to.eq('foo.js')
|
|
})
|
|
|
|
it('is noop without cache buster', () => {
|
|
const file = 'foo.js'
|
|
|
|
expect(CacheBuster.strip(file)).to.eq('foo.js')
|
|
})
|
|
})
|
|
})
|