@sprucelabs/spruce-templates 24.0.0 → 24.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/index.js CHANGED
@@ -114,7 +114,10 @@ exports.templates = {
114
114
  return template(options);
115
115
  },
116
116
  test(options) {
117
- const template = templateImporter_utility_1.default.getTemplate('test/Test.test.ts.hbs');
117
+ const { testType } = options;
118
+ const template = templateImporter_utility_1.default.getTemplate(testType === 'static'
119
+ ? 'test/StaticTest.test.ts.hbs'
120
+ : 'test/Test.test.ts.hbs');
118
121
  return template(options);
119
122
  },
120
123
  fieldsTypes(options) {
@@ -50,8 +50,6 @@ export default async (event: SpruceEvent): SpruceEventResponse => {
50
50
  const skill = await registerOrLoginSkill(client, name, slug)
51
51
  await client.emit(`logout::v2020_12_25`)
52
52
 
53
- debugger
54
-
55
53
  await client.authenticate({
56
54
  skillId: skill.id,
57
55
  apiKey: skill.apiKey,
@@ -0,0 +1,20 @@
1
+ {{#if isTestFixturesInstalled}}import { fake } from '@sprucelabs/spruce-test-fixtures'{{/if}}
2
+ import {{#unless (isDefined parentTestClass)}}AbstractSpruceTest, {{/unless}}{ test, assert } from '@sprucelabs/test-utils'
3
+ {{#if (isDefined parentTestClass)}}import {{#if parentTestClass.isDefaultExport}}{{parentTestClass.name}}{{else}}{ {{parentTestClass.name}} }{{/if}} from '{{parentTestClass.importPath}}'
4
+ {{/if}}
5
+
6
+ {{#if isTestFixturesInstalled}}@fake.login(){{/if}}
7
+ export default class {{namePascal}}Test extends {{#if (isDefined parentTestClass)}}{{parentTestClass.name}}{{else}}AbstractSpruceTest{{/if}} {
8
+ @test()
9
+ protected static async canCreate{{namePascal}}() {
10
+ const {{nameCamel}} = new {{namePascal}}()
11
+ assert.isTruthy({{nameCamel}})
12
+ }
13
+
14
+ @test()
15
+ protected static async yourNextTest() {
16
+ assert.isTrue(false)
17
+ }
18
+ }
19
+
20
+ class {{namePascal}} {}
@@ -1,18 +1,19 @@
1
1
  {{#if isTestFixturesInstalled}}import { fake } from '@sprucelabs/spruce-test-fixtures'{{/if}}
2
- import {{#unless (isDefined parentTestClass)}}AbstractSpruceTest, {{/unless}}{ test, assert } from '@sprucelabs/test-utils'
2
+ import {{#unless (isDefined parentTestClass)}}AbstractSpruceTest, {{/unless}}{ test, suite, assert } from '@sprucelabs/test-utils'
3
3
  {{#if (isDefined parentTestClass)}}import {{#if parentTestClass.isDefaultExport}}{{parentTestClass.name}}{{else}}{ {{parentTestClass.name}} }{{/if}} from '{{parentTestClass.importPath}}'
4
4
  {{/if}}
5
5
 
6
6
  {{#if isTestFixturesInstalled}}@fake.login(){{/if}}
7
+ @suite()
7
8
  export default class {{namePascal}}Test extends {{#if (isDefined parentTestClass)}}{{parentTestClass.name}}{{else}}AbstractSpruceTest{{/if}} {
8
9
  @test()
9
- protected static async canCreate{{namePascal}}() {
10
+ protected async canCreate{{namePascal}}() {
10
11
  const {{nameCamel}} = new {{namePascal}}()
11
12
  assert.isTruthy({{nameCamel}})
12
13
  }
13
14
 
14
15
  @test()
15
- protected static async yourNextTest() {
16
+ protected async yourNextTest() {
16
17
  assert.isTrue(false)
17
18
  }
18
19
  }
@@ -61,6 +61,7 @@ export interface TestOptions {
61
61
  namePascal: string;
62
62
  nameCamel: string;
63
63
  isTestFixturesInstalled: boolean;
64
+ testType?: 'static' | 'instance';
64
65
  parentTestClass?: {
65
66
  name: string;
66
67
  importPath: string;
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "24.0.0",
6
+ "version": "24.1.0",
7
7
  "files": [
8
8
  "build/**/*",
9
9
  "tsconfig.json",
@@ -56,10 +56,10 @@
56
56
  "watch.tsc": "tsc -w"
57
57
  },
58
58
  "dependencies": {
59
- "@sprucelabs/mercury-types": "^47.2.0",
60
- "@sprucelabs/schema": "^31.0.19",
61
- "@sprucelabs/spruce-event-utils": "^40.1.394",
62
- "@sprucelabs/spruce-skill-utils": "^31.2.16",
59
+ "@sprucelabs/mercury-types": "^47.2.28",
60
+ "@sprucelabs/schema": "^31.0.44",
61
+ "@sprucelabs/spruce-event-utils": "^40.2.32",
62
+ "@sprucelabs/spruce-skill-utils": "^31.2.47",
63
63
  "fs-extra": "^11.2.0",
64
64
  "handlebars": "^4.7.8",
65
65
  "lodash": "^4.17.21",
@@ -67,16 +67,16 @@
67
67
  },
68
68
  "devDependencies": {
69
69
  "@types/fs-extra": "^11.0.4",
70
- "@types/lodash": "^4.17.14",
71
- "@types/node": "^22.10.7",
70
+ "@types/lodash": "^4.17.15",
71
+ "@types/node": "^22.13.4",
72
72
  "chokidar-cli": "^3.0.0",
73
73
  "concurrently": "^9.1.2",
74
74
  "conventional-changelog-sprucelabs": "2.0.1",
75
- "prettier": "^3.4.2",
75
+ "prettier": "^3.5.1",
76
76
  "typescript": "^5.7.3"
77
77
  },
78
78
  "yarn-upgrade-all": {
79
79
  "ignore": []
80
80
  },
81
- "gitHead": "4ae8247c0a6aeb36bc8d249c50303e01decb96c2"
81
+ "gitHead": "1dba2146c4738dbd9c94b2937b3553addee5a1a4"
82
82
  }