ag/templates/_plugin_test.js
2024-03-15 22:32:19 +08:00

19 lines
435 B
JavaScript

// run "ag export plugins" to make plugins code
import logger from 'plugins/logger';
import {{.name}} from 'plugins/{{.name}}';
{{.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