Skip to content
This repository has been archived by the owner on Apr 21, 2022. It is now read-only.

Commit

Permalink
fix: rename publish.test.ts (#130)
Browse files Browse the repository at this point in the history
  • Loading branch information
RasPhilCo committed Jan 28, 2020
1 parent 6e7c356 commit 1a90ece
Showing 1 changed file with 33 additions and 33 deletions.
66 changes: 33 additions & 33 deletions test/publist.test.ts → test/publish.test.ts
Expand Up @@ -11,7 +11,7 @@ const target = [process.platform, process.arch].join('-')

const skipIfWindows = process.platform === 'win32' ? test.skip() : test
const testRun = `test-${Math.random().toString().split('.')[1].slice(0, 4)}`
let s3UploadedFiles: string[] = []
const s3UploadedFiles: string[] = []

describe('publish', () => {
beforeEach(async () => {
Expand Down Expand Up @@ -61,41 +61,41 @@ describe('publish', () => {

describe('with filter', () => {
skipIfWindows
.stub(qq, 'x', ({
stdout: () => Promise.resolve(),
exec: () => Promise.resolve()
}))
.stub(qq, 'exists', () => true)
.stub(aws, 's3', () => ({
uploadFile: (file: string) => {
s3UploadedFiles.push(file)
}
}))
.command(['publish', '-t', 'linux-x64'])
.it('publishes only the specified target', async () => {
expect(s3UploadedFiles.join()).to.contain('linux-x64')
expect(s3UploadedFiles.join()).to.not.contain('win32-x64')
expect(s3UploadedFiles.join()).to.not.contain('darwin-x64')
})
.stub(qq, 'x', ({
stdout: () => Promise.resolve(),
exec: () => Promise.resolve(),
}))
.stub(qq, 'exists', () => true)
.stub(aws, 's3', () => ({
uploadFile: (file: string) => {
s3UploadedFiles.push(file)
},
}))
.command(['publish', '-t', 'linux-x64'])
.it('publishes only the specified target', async () => {
expect(s3UploadedFiles.join()).to.contain('linux-x64')
expect(s3UploadedFiles.join()).to.not.contain('win32-x64')
expect(s3UploadedFiles.join()).to.not.contain('darwin-x64')
})
})

describe('without filter', () => {
skipIfWindows
.stub(qq, 'x', ({
stdout: () => Promise.resolve(),
exec: () => Promise.resolve()
}))
.stub(qq, 'exists', () => true)
.stub(aws, 's3', () => ({
uploadFile: (file: string) => {
s3UploadedFiles.push(file)
}
}))
.command(['publish'])
.it('publishes all', async () => {
expect(s3UploadedFiles.join()).to.contain('linux-x64')
expect(s3UploadedFiles.join()).to.contain('win32-x64')
expect(s3UploadedFiles.join()).to.contain('darwin-x64')
})
.stub(qq, 'x', ({
stdout: () => Promise.resolve(),
exec: () => Promise.resolve(),
}))
.stub(qq, 'exists', () => true)
.stub(aws, 's3', () => ({
uploadFile: (file: string) => {
s3UploadedFiles.push(file)
},
}))
.command(['publish'])
.it('publishes all', async () => {
expect(s3UploadedFiles.join()).to.contain('linux-x64')
expect(s3UploadedFiles.join()).to.contain('win32-x64')
expect(s3UploadedFiles.join()).to.contain('darwin-x64')
})
})
})

0 comments on commit 1a90ece

Please sign in to comment.