@@ -2,47 +2,32 @@ import { test } from "uvu";
22import * as assert from "uvu/assert" ;
33
44import { Base } from "../index.js" ;
5-
6- const fooPlugin = ( test ) => {
7- return {
8- foo : ( ) => "foo" ,
9- } ;
10- } ;
11- const barPlugin = ( test ) => {
12- return {
13- bar : ( ) => "bar" ,
14- } ;
15- } ;
16- const pluginWithEmptyObjectReturn = ( test ) => {
17- return { } ;
18- } ;
5+ import { fooPlugin } from "../plugins/foo/index.js" ;
6+ import { barPlugin } from "../plugins/bar/index.js" ;
7+ import { voidPlugin } from "../plugins/void/index.js" ;
198
209test ( ".plugin(fooPlugin)" , ( ) => {
2110 const FooTest = Base . plugin ( fooPlugin ) ;
2211 const fooTest = new FooTest ( ) ;
23- assert . equal ( fooTest . foo ( ) , "foo" ) ;
12+ assert . equal ( fooTest . foo , "foo" ) ;
2413} ) ;
2514test ( ".plugin(fooPlugin, barPlugin)" , ( ) => {
2615 const FooBarTest = Base . plugin ( fooPlugin , barPlugin ) ;
2716 const fooBarTest = new FooBarTest ( ) ;
28- assert . equal ( fooBarTest . foo ( ) , "foo" ) ;
29- assert . equal ( fooBarTest . bar ( ) , "bar" ) ;
17+ assert . equal ( fooBarTest . foo , "foo" ) ;
18+ assert . equal ( fooBarTest . bar , "bar" ) ;
3019} ) ;
31- test ( ".plugin(fooPlugin, barPlugin, pluginWithVoidReturn)" , ( ) => {
32- const FooBarTest = Base . plugin (
33- fooPlugin ,
34- barPlugin ,
35- pluginWithEmptyObjectReturn
36- ) ;
20+ test ( ".plugin(fooPlugin, barPlugin, voidPlugin)" , ( ) => {
21+ const FooBarTest = Base . plugin ( fooPlugin , barPlugin , voidPlugin ) ;
3722 const fooBarTest = new FooBarTest ( ) ;
38- assert . equal ( fooBarTest . foo ( ) , "foo" ) ;
39- assert . equal ( fooBarTest . bar ( ) , "bar" ) ;
23+ assert . equal ( fooBarTest . foo , "foo" ) ;
24+ assert . equal ( fooBarTest . bar , "bar" ) ;
4025} ) ;
4126test ( ".plugin(fooPlugin).plugin(barPlugin)" , ( ) => {
4227 const FooBarTest = Base . plugin ( fooPlugin ) . plugin ( barPlugin ) ;
4328 const fooBarTest = new FooBarTest ( ) ;
44- assert . equal ( fooBarTest . foo ( ) , "foo" ) ;
45- assert . equal ( fooBarTest . bar ( ) , "bar" ) ;
29+ assert . equal ( fooBarTest . foo , "foo" ) ;
30+ assert . equal ( fooBarTest . bar , "bar" ) ;
4631} ) ;
4732test ( ".defaults({foo: 'bar'})" , ( ) => {
4833 const BaseWithDefaults = Base . defaults ( { foo : "bar" } ) ;
@@ -63,9 +48,9 @@ test(".plugin().defaults()", () => {
6348 const instance1 = new BaseWithPluginAndDefaults ( ) ;
6449 const instance2 = new BaseWithDefaultsAndPlugin ( ) ;
6550
66- assert . equal ( instance1 . foo ( ) , "foo" ) ;
51+ assert . equal ( instance1 . foo , "foo" ) ;
6752 assert . equal ( instance1 . options , { baz : "daz" } ) ;
68- assert . equal ( instance2 . foo ( ) , "foo" ) ;
53+ assert . equal ( instance2 . foo , "foo" ) ;
6954 assert . equal ( instance2 . options , { baz : "daz" } ) ;
7055} ) ;
7156
0 commit comments