11import { Resource } from './resource.js' ;
2- import { ResourceOperation } from 'codify-schemas' ;
2+ import { OS , ResourceOperation } from 'codify-schemas' ;
33import { spy } from 'sinon' ;
44import { describe , expect , it } from 'vitest'
55import { ArrayParameterSetting , ParameterSetting , ResourceSettings } from './resource-settings.js' ;
@@ -19,6 +19,7 @@ describe('Resource tests', () => {
1919 getSettings ( ) : ResourceSettings < TestConfig > {
2020 return {
2121 id : 'type' ,
22+ operatingSystems : [ OS . Darwin ] ,
2223 dependencies : [ 'homebrew' , 'python' ] ,
2324 parameterSettings : {
2425 propA : {
@@ -197,6 +198,7 @@ describe('Resource tests', () => {
197198 getSettings ( ) : ResourceSettings < TestConfig > {
198199 return {
199200 id : 'resource' ,
201+ operatingSystems : [ OS . Darwin ] ,
200202 parameterSettings : {
201203 propA : { canModify : true } ,
202204 propB : { canModify : true } ,
@@ -232,6 +234,7 @@ describe('Resource tests', () => {
232234 getSettings ( ) : ResourceSettings < TestConfig > {
233235 return {
234236 id : 'type' ,
237+ operatingSystems : [ OS . Darwin ] ,
235238 dependencies : [ 'homebrew' , 'python' ] ,
236239 parameterSettings : {
237240 propA : { canModify : true } ,
@@ -254,6 +257,7 @@ describe('Resource tests', () => {
254257 getSettings ( ) : ResourceSettings < TestConfig > {
255258 return {
256259 id : 'type' ,
260+ operatingSystems : [ OS . Darwin ] ,
257261 dependencies : [ 'homebrew' , 'python' ] ,
258262 parameterSettings : {
259263 propA : { canModify : true } ,
@@ -270,6 +274,7 @@ describe('Resource tests', () => {
270274 getSettings ( ) : ResourceSettings < TestConfig > {
271275 return {
272276 id : 'type' ,
277+ operatingSystems : [ OS . Darwin ] ,
273278 parameterSettings : {
274279 propA : { default : 'propADefault' }
275280 }
@@ -298,6 +303,7 @@ describe('Resource tests', () => {
298303 getSettings ( ) : ResourceSettings < TestConfig > {
299304 return {
300305 id : 'type' ,
306+ operatingSystems : [ OS . Darwin ] ,
301307 parameterSettings : {
302308 propE : { default : 'propEDefault' }
303309 }
@@ -325,6 +331,7 @@ describe('Resource tests', () => {
325331 getSettings ( ) : ResourceSettings < TestConfig > {
326332 return {
327333 id : 'type' ,
334+ operatingSystems : [ OS . Darwin ] ,
328335 parameterSettings : {
329336 propE : { default : 'propEDefault' }
330337 }
@@ -348,6 +355,7 @@ describe('Resource tests', () => {
348355 getSettings ( ) : ResourceSettings < TestConfig > {
349356 return {
350357 id : 'type' ,
358+ operatingSystems : [ OS . Darwin ] ,
351359 parameterSettings : {
352360 propA : { default : 'propADefault' }
353361 }
@@ -376,6 +384,7 @@ describe('Resource tests', () => {
376384 getSettings ( ) : ResourceSettings < TestConfig > {
377385 return {
378386 id : 'type' ,
387+ operatingSystems : [ OS . Darwin ] ,
379388 parameterSettings : {
380389 propA : { default : 'propADefault' }
381390 }
@@ -392,7 +401,7 @@ describe('Resource tests', () => {
392401 it ( 'Has the correct typing for applys' , ( ) => {
393402 const resource = new class extends Resource < TestConfig > {
394403 getSettings ( ) : ResourceSettings < TestConfig > {
395- return { id : 'type' }
404+ return { id : 'type' , operatingSystems : [ OS . Darwin ] , }
396405 }
397406
398407 async refresh ( ) : Promise < Partial < TestConfig > | null > {
@@ -418,7 +427,8 @@ describe('Resource tests', () => {
418427 const parameter1 = new class extends StatefulParameter < any , any > {
419428 getSettings ( ) : ParameterSetting {
420429 return {
421- type : 'version'
430+ type : 'version' ,
431+ operatingSystems : [ OS . Darwin ] ,
422432 }
423433 }
424434
@@ -462,6 +472,7 @@ describe('Resource tests', () => {
462472 getSettings ( ) : ResourceSettings < TestConfig > {
463473 return {
464474 id : 'nvm' ,
475+ operatingSystems : [ OS . Darwin ] ,
465476 parameterSettings : {
466477 global : { type : 'stateful' , definition : parameter1 , order : 2 } ,
467478 nodeVersions : { type : 'stateful' , definition : parameter2 , order : 1 } ,
@@ -514,6 +525,7 @@ describe('Resource tests', () => {
514525 getSettings ( ) : ResourceSettings < TestConfig > {
515526 return {
516527 id : 'nvm' ,
528+ operatingSystems : [ OS . Darwin ] ,
517529 parameterSettings : {
518530 global : { type : 'stateful' , definition : parameter1 , order : 2 } ,
519531 nodeVersions : { type : 'stateful' , definition : parameter2 , order : 1 } ,
@@ -546,6 +558,7 @@ describe('Resource tests', () => {
546558 getSettings ( ) : ResourceSettings < TestConfig > {
547559 return {
548560 id : 'resourceType' ,
561+ operatingSystems : [ OS . Darwin ] ,
549562 parameterSettings : {
550563 propD : {
551564 type : 'array' ,
@@ -630,6 +643,7 @@ describe('Resource tests', () => {
630643 getSettings ( ) : ResourceSettings < TestConfig > {
631644 return {
632645 id : 'resourceType' ,
646+ operatingSystems : [ OS . Darwin ] ,
633647 parameterSettings : {
634648 propD : {
635649 type : 'array' ,
@@ -720,6 +734,7 @@ describe('Resource tests', () => {
720734 getSettings ( ) : ResourceSettings < TestConfig > {
721735 return {
722736 id : 'resourceType' ,
737+ operatingSystems : [ OS . Darwin ] ,
723738 parameterSettings : {
724739 propA : { type : 'string' , default : 'defaultValue' } ,
725740 propB : { type : 'boolean' , default : true }
@@ -755,6 +770,7 @@ describe('Resource tests', () => {
755770 getSettings ( ) : ResourceSettings < any > {
756771 return {
757772 id : 'path' ,
773+ operatingSystems : [ OS . Darwin ] ,
758774 parameterSettings : {
759775 path : { type : 'string' , isEqual : 'directory' } ,
760776 paths : { canModify : true , type : 'array' , isElementEqual : 'directory' } ,
@@ -797,6 +813,7 @@ describe('Resource tests', () => {
797813 getSettings ( ) : ResourceSettings < any > {
798814 return {
799815 id : 'path' ,
816+ operatingSystems : [ OS . Darwin ] ,
800817 parameterSettings : {
801818 path : { type : 'string' , isEqual : 'directory' } ,
802819 paths : { canModify : true , type : 'array' , isElementEqual : 'directory' } ,
@@ -840,6 +857,7 @@ describe('Resource tests', () => {
840857 getSettings ( ) : ResourceSettings < any > {
841858 return {
842859 id : 'path' ,
860+ operatingSystems : [ OS . Darwin ] ,
843861 parameterSettings : {
844862 path : { type : 'directory' } ,
845863 paths : { canModify : true , type : 'array' , itemType : 'directory' } ,
0 commit comments