mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-04-18 06:49:50 +02:00
Notify of plugin updates and add update UX (#339)
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@yaak/faker",
|
||||
"private": true,
|
||||
"version": "0.1.0",
|
||||
"version": "1.1.1",
|
||||
"displayName": "Faker",
|
||||
"description": "Template functions for generating fake data using FakerJS",
|
||||
"repository": {
|
||||
@@ -11,7 +11,8 @@
|
||||
},
|
||||
"scripts": {
|
||||
"build": "yaakcli build",
|
||||
"dev": "yaakcli dev"
|
||||
"dev": "yaakcli dev",
|
||||
"test": "vitest --run tests"
|
||||
},
|
||||
"dependencies": {
|
||||
"@faker-js/faker": "^10.1.0"
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
declare module '@faker-js/faker';
|
||||
@@ -65,7 +65,7 @@ export const plugin: PluginDefinition = {
|
||||
name: ['faker', modName, fnName].join('.'),
|
||||
args: args(modName, fnName),
|
||||
async onRender(_ctx, args) {
|
||||
const fn = mod[fnName] as (...a: unknown[]) => unknown;
|
||||
const fn = mod[fnName as keyof typeof mod] as (...a: unknown[]) => unknown;
|
||||
const options = args.values.options;
|
||||
|
||||
// No options supplied
|
||||
|
||||
9
plugins-external/faker/tests/init.test.ts
Normal file
9
plugins-external/faker/tests/init.test.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import { describe, expect, it } from 'vitest';
|
||||
|
||||
describe('formatDatetime', () => {
|
||||
it('returns formatted current date', async () => {
|
||||
// Ensure the plugin imports properly
|
||||
const faker = await import('../src/index');
|
||||
expect(faker.plugin.templateFunctions?.length).toBe(226);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user