-
Notifications
You must be signed in to change notification settings - Fork 353
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
149 additions
and
91 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/usr/bin/env node --no-warnings --loader ts-node/esm | ||
|
||
import { test } from 'tstest' | ||
import { Wechaty } from 'wechaty' | ||
|
||
import { | ||
mock, | ||
PuppetMock, | ||
} from 'wechaty-puppet-mock' | ||
|
||
test('wechaty-puppet-service', async t => { | ||
const mocker = new mock.Mocker() | ||
mocker.use(mock.SimpleEnvironment()) | ||
const puppetMock = new PuppetMock({ mocker }) | ||
|
||
const bot = new Wechaty({ | ||
puppet: puppetMock, | ||
}) | ||
|
||
const timer = setTimeout(() => { | ||
console.error('Smoke testing timeout after 2 minutes.') | ||
process.exit(1) | ||
}, 120 * 1000) | ||
|
||
const future = new Promise(resolve => bot.once('scan', resolve)) | ||
await bot.start() | ||
await future | ||
await bot.stop() | ||
|
||
clearTimeout(timer) | ||
t.pass(`Puppet ${bot.puppet} v${bot.puppet.version()} smoke testing passed.`) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/usr/bin/env node --no-warnings --loader ts-node/esm | ||
|
||
import { test } from 'tstest' | ||
import { Wechaty } from 'wechaty' | ||
|
||
test('wechaty-puppet-service', async t => { | ||
const bot = new Wechaty({ | ||
puppet: 'wechaty-puppet-service', | ||
/** | ||
* Huan(202108): our puppet service token is no-TLS for now. | ||
* FIXME: enable TLS in the future | ||
*/ | ||
puppetOptions: { tls: { disable: true } }, | ||
}) | ||
|
||
const timer = setTimeout(() => { | ||
console.error('Smoke testing timeout after 2 minutes.') | ||
process.exit(1) | ||
}, 120 * 1000) | ||
|
||
const future = new Promise(resolve => bot.once('scan', resolve)) | ||
await bot.start() | ||
await future | ||
await bot.stop() | ||
|
||
clearTimeout(timer) | ||
t.pass(`Puppet ${bot.puppet} v${bot.puppet.version()} smoke testing passed.`) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/usr/bin/env node --no-warnings --loader ts-node/esm | ||
|
||
import { test } from 'tstest' | ||
import { Wechaty } from 'wechaty' | ||
|
||
test('wechaty-puppet-wechat', async t => { | ||
const optionsWeChat = { | ||
puppet: 'wechaty-puppet-wechat' as const, | ||
puppetOptions: { | ||
launchOptions: { | ||
ignoreDefaultArgs: ['--disable-extensions'], | ||
}, | ||
}, | ||
} | ||
|
||
const bot = new Wechaty(optionsWeChat) | ||
|
||
const timer = setTimeout(() => { | ||
console.error('Smoke testing timeout after 2 minutes.') | ||
process.exit(1) | ||
}, 120 * 1000) | ||
|
||
const future = new Promise(resolve => bot.once('scan', resolve)) | ||
await bot.start() | ||
await future | ||
await bot.stop() | ||
|
||
clearTimeout(timer) | ||
t.pass(`Puppet ${bot.puppet} v${bot.puppet.version()} smoke testing passed.`) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/usr/bin/env node --no-warnings --loader ts-node/esm | ||
|
||
import { test } from 'tstest' | ||
import { Wechaty } from 'wechaty' | ||
|
||
test('wechaty-puppet-wechat4u', async t => { | ||
const bot = new Wechaty({ puppet: 'wechaty-puppet-wechat4u' }) | ||
|
||
const timer = setTimeout(() => { | ||
console.error('Smoke testing timeout after 2 minutes.') | ||
process.exit(1) | ||
}, 120 * 1000) | ||
|
||
const future = new Promise(resolve => bot.once('scan', resolve)) | ||
await bot.start() | ||
await future | ||
await bot.stop() | ||
|
||
clearTimeout(timer) | ||
t.pass(`Puppet ${bot.puppet} v${bot.puppet.version()} smoke testing passed.`) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,7 @@ | |
"examples/**/*.ts", | ||
"scripts/**/*.ts", | ||
"src/**/*.ts", | ||
"tests/**/*.spec.ts" | ||
"tests/**/*.ts" | ||
] | ||
} | ||
|