2017-09-14 05:20:26 +00:00
|
|
|
import { expect, tap } from 'tapbundle'
|
2017-09-17 12:53:00 +00:00
|
|
|
import { Qenv } from 'qenv'
|
|
|
|
|
|
|
|
let testQenv = new Qenv(process.cwd(), process.cwd() + '/.nogit')
|
|
|
|
|
2017-09-14 05:20:26 +00:00
|
|
|
import * as slackme from '../ts/index'
|
|
|
|
|
2017-09-17 12:53:00 +00:00
|
|
|
let testSlackme: slackme.Slackme
|
|
|
|
|
|
|
|
tap.test('should create a valid slackme instance', async () => {
|
|
|
|
testSlackme = new slackme.Slackme(process.env.SLACK_TOKEN)
|
|
|
|
})
|
|
|
|
|
|
|
|
tap.test('should send a message to Slack', async () => {
|
|
|
|
let slackMessage = new slackme.SlackMessage({
|
|
|
|
text: 'hi. This is a text',
|
|
|
|
color: '#3cb371'
|
|
|
|
})
|
|
|
|
testSlackme.sendMessage(slackMessage, 'random')
|
2017-09-14 05:20:26 +00:00
|
|
|
})
|
|
|
|
|
|
|
|
tap.start()
|