Files
cypress/scripts/unit/binary/upload-spec.js
Gleb Bahmutov ebaa7a375c Copy test runner binaries before releasing new version (#4082)
* adding S3 sdk

* test binary folder

* linting

* before searching for binary

* linting

* grab folders in the given S3 prefix

* grab folders in the given S3 prefix

* find the last build

* found last builds for commit

* refactoring

* add tests for upload dir name

* create destination zip filename

* copying S3 files

* move s3 helpers into own object, prepare for testing

* add realistic test

* linting

* chore: add documentation to DEPLOY.md file
2019-05-01 10:14:25 -04:00

55 lines
1.3 KiB
JavaScript

require('../../spec-helper')
const snapshot = require('snap-shot-it')
const la = require('lazy-ass')
const os = require('os')
/* eslint-env mocha */
/* global sinon */
describe('upload', () => {
const upload = require('../../binary/upload')
context('getRemoteManifest', () => {
it('returns object with download urls for each platform', () => {
const folder = 'desktop'
const version = '3.3.0'
const manifest = upload.getRemoteManifest(folder, version)
snapshot('test runner manifest', manifest)
})
})
context('getUploadeVersionFolder', () => {
it('returns folder', () => {
const aws = {
folder: 'desktop',
}
const folder = upload.getUploadeVersionFolder(aws, '3.3.0')
la(folder === 'desktop/3.3.0', 'wrong desktop folder', folder)
})
})
context('getUploadDirName', () => {
it('returns folder with platform', () => {
const aws = {
folder: 'desktop',
}
sinon.stub(upload, 'getAwsObj').returns(aws)
sinon.stub(os, 'arch').returns('x64')
const folder = upload.getUploadDirName({
platform: 'darwin',
version: '3.3.0',
})
la(
folder === 'desktop/3.3.0/darwin-x64/',
'wrong upload desktop folder',
folder
)
})
})
})