chore(release): v1.0.0

This commit is contained in:
seepine
2023-08-06 22:58:51 +08:00
commit 826fb2bfd9
38 changed files with 68707 additions and 0 deletions

BIN
__tests__/dist/preview.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

41
__tests__/dist/project.config.json vendored Normal file
View File

@@ -0,0 +1,41 @@
{
"description": "小程序项目配置文件。",
"packOptions": {
"ignore": []
},
"setting": {
"urlCheck": false,
"es6": true,
"postcss": true,
"minified": true,
"newFeature": true,
"es7": true,
"minify": true,
"minifyJS": true,
"minifyWXML": true,
"minifyWXSS": true,
"autoPrefixWXSS": true
},
"compileType": "miniprogram",
"libVersion": "",
"appid": "wx2ec97gd31w864xxxx",
"projectname": "",
"condition": {
"search": {
"current": -1,
"list": []
},
"conversation": {
"current": -1,
"list": []
},
"game": {
"current": -1,
"list": []
},
"miniprogram": {
"current": -1,
"list": []
}
}
}

32
__tests__/main.test.ts Normal file
View File

@@ -0,0 +1,32 @@
import * as process from 'process'
import * as cp from 'child_process'
import * as path from 'path'
import {expect, test} from '@jest/globals'
// shows how the runner will run a javascript action with env / stdout protocol
test('test runs', () => {
process.env['INPUT_MODE'] = 'test'
process.env['INPUT_PROJECT-PATH'] = '../__tests__/dist'
process.env['INPUT_PRIVATE-KEY'] = 'theInputPrivateKey'
const np = process.execPath
const ip = path.join(__dirname, '..', 'lib', 'main.js')
const options: cp.ExecFileSyncOptions = {
env: process.env
}
console.log(cp.execFileSync(np, [ip], options).toString())
})
// shows how the runner will run a javascript action with env / stdout protocol
test('test output', () => {
process.env['INPUT_MODE'] = 'test'
process.env['INPUT_PROJECT-PATH'] = '../__tests__/dist'
process.env['INPUT_PRIVATE-KEY'] = 'theInputPrivateKey'
process.env['INPUT_OUTPUT'] =
'appid={appid},version={version}\n```\n{qrcode}\n```\n'
const np = process.execPath
const ip = path.join(__dirname, '..', 'lib', 'main.js')
const options: cp.ExecFileSyncOptions = {
env: process.env
}
console.log(cp.execFileSync(np, [ip], options).toString())
})

8
__tests__/qrcode.test.ts Normal file
View File

@@ -0,0 +1,8 @@
import {test} from '@jest/globals'
import {getQrCode, generate} from '../src/utils/qrcode'
test('qrcode generate', async () => {
const qrcodeData = await getQrCode('./__tests__/dist/preview.png')
const qrcode = await generate(qrcodeData)
console.log(qrcode)
})