ag/templates/_plugin_test.js

20 lines
447 B
JavaScript
Raw Normal View History

2024-03-15 22:32:19 +08:00
// run "ag export plugins" to make plugins code
2024-03-16 22:54:11 +08:00
import logger from 'logger'
import console from 'console'
import {{.name}} from '{{.name}}'
2024-03-15 22:32:19 +08:00
{{.name}}.set('aaa', 111)
let aaa = {{.name}}.get('aaa')
if (aaa !== 111) return 'set value error'
try {
{{.name}}.get('bbb')
return 'no exception when getting non-existent key'
} catch (ex){
logger.error(ex.message, {stack:ex.stack})
}
logger.info('aaa')
{{.name}}.remove('bbb')
return true