@friggframework/serverless-plugin 2.0.0--canary.461.35d292b.0 → 2.0.0--canary.461.e679ea5.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/index.test.js +25 -25
- package/package.json +2 -2
package/index.test.js
CHANGED
|
@@ -13,7 +13,7 @@ describe('FriggServerlessPlugin', () => {
|
|
|
13
13
|
|
|
14
14
|
beforeEach(() => {
|
|
15
15
|
mockServicePath = '/test/service/path';
|
|
16
|
-
|
|
16
|
+
|
|
17
17
|
mockServerless = {
|
|
18
18
|
config: {
|
|
19
19
|
servicePath: mockServicePath,
|
|
@@ -64,10 +64,10 @@ describe('FriggServerlessPlugin', () => {
|
|
|
64
64
|
describe('asyncInit - Directory Creation', () => {
|
|
65
65
|
it('should create .esbuild/.serverless directory if it does not exist', async () => {
|
|
66
66
|
plugin = new FriggServerlessPlugin(mockServerless, mockOptions);
|
|
67
|
-
|
|
67
|
+
|
|
68
68
|
// Mock fs.existsSync to return false (directory doesn't exist)
|
|
69
69
|
fs.existsSync.mockReturnValue(false);
|
|
70
|
-
fs.mkdirSync.mockImplementation(() => {});
|
|
70
|
+
fs.mkdirSync.mockImplementation(() => { });
|
|
71
71
|
|
|
72
72
|
// Spy on console.log
|
|
73
73
|
const consoleLogSpy = jest.spyOn(console, 'log').mockImplementation();
|
|
@@ -78,10 +78,10 @@ describe('FriggServerlessPlugin', () => {
|
|
|
78
78
|
|
|
79
79
|
// Verify directory existence check
|
|
80
80
|
expect(fs.existsSync).toHaveBeenCalledWith(expectedPath);
|
|
81
|
-
|
|
81
|
+
|
|
82
82
|
// Verify directory creation
|
|
83
83
|
expect(fs.mkdirSync).toHaveBeenCalledWith(expectedPath, { recursive: true });
|
|
84
|
-
|
|
84
|
+
|
|
85
85
|
// Verify success message
|
|
86
86
|
expect(consoleLogSpy).toHaveBeenCalledWith(
|
|
87
87
|
expect.stringContaining('Created')
|
|
@@ -95,10 +95,10 @@ describe('FriggServerlessPlugin', () => {
|
|
|
95
95
|
|
|
96
96
|
it('should not create directory if it already exists', async () => {
|
|
97
97
|
plugin = new FriggServerlessPlugin(mockServerless, mockOptions);
|
|
98
|
-
|
|
98
|
+
|
|
99
99
|
// Mock fs.existsSync to return true (directory exists)
|
|
100
100
|
fs.existsSync.mockReturnValue(true);
|
|
101
|
-
fs.mkdirSync.mockImplementation(() => {});
|
|
101
|
+
fs.mkdirSync.mockImplementation(() => { });
|
|
102
102
|
|
|
103
103
|
const consoleLogSpy = jest.spyOn(console, 'log').mockImplementation();
|
|
104
104
|
|
|
@@ -108,10 +108,10 @@ describe('FriggServerlessPlugin', () => {
|
|
|
108
108
|
|
|
109
109
|
// Verify directory existence check
|
|
110
110
|
expect(fs.existsSync).toHaveBeenCalledWith(expectedPath);
|
|
111
|
-
|
|
111
|
+
|
|
112
112
|
// Verify directory creation was NOT called
|
|
113
113
|
expect(fs.mkdirSync).not.toHaveBeenCalled();
|
|
114
|
-
|
|
114
|
+
|
|
115
115
|
// Verify success message was NOT logged
|
|
116
116
|
expect(consoleLogSpy).not.toHaveBeenCalledWith(
|
|
117
117
|
expect.stringContaining('Created')
|
|
@@ -123,11 +123,11 @@ describe('FriggServerlessPlugin', () => {
|
|
|
123
123
|
it('should use process.cwd() if servicePath is not available', async () => {
|
|
124
124
|
// Remove servicePath from config
|
|
125
125
|
mockServerless.config.servicePath = undefined;
|
|
126
|
-
|
|
126
|
+
|
|
127
127
|
plugin = new FriggServerlessPlugin(mockServerless, mockOptions);
|
|
128
|
-
|
|
128
|
+
|
|
129
129
|
fs.existsSync.mockReturnValue(false);
|
|
130
|
-
fs.mkdirSync.mockImplementation(() => {});
|
|
130
|
+
fs.mkdirSync.mockImplementation(() => { });
|
|
131
131
|
|
|
132
132
|
await plugin.asyncInit();
|
|
133
133
|
|
|
@@ -139,7 +139,7 @@ describe('FriggServerlessPlugin', () => {
|
|
|
139
139
|
|
|
140
140
|
it('should log initialization messages', async () => {
|
|
141
141
|
plugin = new FriggServerlessPlugin(mockServerless, mockOptions);
|
|
142
|
-
|
|
142
|
+
|
|
143
143
|
fs.existsSync.mockReturnValue(true);
|
|
144
144
|
|
|
145
145
|
const consoleLogSpy = jest.spyOn(console, 'log').mockImplementation();
|
|
@@ -157,9 +157,9 @@ describe('FriggServerlessPlugin', () => {
|
|
|
157
157
|
describe('asyncInit - Offline Mode', () => {
|
|
158
158
|
it('should not create SQS queues when not in offline mode', async () => {
|
|
159
159
|
plugin = new FriggServerlessPlugin(mockServerless, mockOptions);
|
|
160
|
-
|
|
160
|
+
|
|
161
161
|
fs.existsSync.mockReturnValue(true);
|
|
162
|
-
|
|
162
|
+
|
|
163
163
|
// Not in offline mode
|
|
164
164
|
mockServerless.processedInput.commands = ['deploy'];
|
|
165
165
|
|
|
@@ -177,9 +177,9 @@ describe('FriggServerlessPlugin', () => {
|
|
|
177
177
|
|
|
178
178
|
it('should create SQS queues when in offline mode', async () => {
|
|
179
179
|
plugin = new FriggServerlessPlugin(mockServerless, mockOptions);
|
|
180
|
-
|
|
180
|
+
|
|
181
181
|
fs.existsSync.mockReturnValue(true);
|
|
182
|
-
|
|
182
|
+
|
|
183
183
|
// Set offline mode
|
|
184
184
|
mockServerless.processedInput.commands = ['offline'];
|
|
185
185
|
mockServerless.service.custom = {
|
|
@@ -215,9 +215,9 @@ describe('FriggServerlessPlugin', () => {
|
|
|
215
215
|
describe('beforePackageInitialize', () => {
|
|
216
216
|
it('should create .esbuild/.serverless directory', () => {
|
|
217
217
|
plugin = new FriggServerlessPlugin(mockServerless, mockOptions);
|
|
218
|
-
|
|
218
|
+
|
|
219
219
|
fs.existsSync.mockReturnValue(false);
|
|
220
|
-
fs.mkdirSync.mockImplementation(() => {});
|
|
220
|
+
fs.mkdirSync.mockImplementation(() => { });
|
|
221
221
|
|
|
222
222
|
plugin.beforePackageInitialize();
|
|
223
223
|
|
|
@@ -229,7 +229,7 @@ describe('FriggServerlessPlugin', () => {
|
|
|
229
229
|
|
|
230
230
|
it('should log pre-package hook message', () => {
|
|
231
231
|
plugin = new FriggServerlessPlugin(mockServerless, mockOptions);
|
|
232
|
-
|
|
232
|
+
|
|
233
233
|
fs.existsSync.mockReturnValue(true);
|
|
234
234
|
|
|
235
235
|
plugin.beforePackageInitialize();
|
|
@@ -241,9 +241,9 @@ describe('FriggServerlessPlugin', () => {
|
|
|
241
241
|
describe('init', () => {
|
|
242
242
|
it('should create .esbuild/.serverless directory', () => {
|
|
243
243
|
plugin = new FriggServerlessPlugin(mockServerless, mockOptions);
|
|
244
|
-
|
|
244
|
+
|
|
245
245
|
fs.existsSync.mockReturnValue(false);
|
|
246
|
-
fs.mkdirSync.mockImplementation(() => {});
|
|
246
|
+
fs.mkdirSync.mockImplementation(() => { });
|
|
247
247
|
|
|
248
248
|
const consoleLogSpy = jest.spyOn(console, 'log').mockImplementation();
|
|
249
249
|
|
|
@@ -264,7 +264,7 @@ describe('FriggServerlessPlugin', () => {
|
|
|
264
264
|
describe('afterPackage', () => {
|
|
265
265
|
it('should log after package hook message', () => {
|
|
266
266
|
plugin = new FriggServerlessPlugin(mockServerless, mockOptions);
|
|
267
|
-
|
|
267
|
+
|
|
268
268
|
const consoleLogSpy = jest.spyOn(console, 'log').mockImplementation();
|
|
269
269
|
|
|
270
270
|
plugin.afterPackage();
|
|
@@ -278,7 +278,7 @@ describe('FriggServerlessPlugin', () => {
|
|
|
278
278
|
describe('beforeDeploy', () => {
|
|
279
279
|
it('should log before deploy hook message', () => {
|
|
280
280
|
plugin = new FriggServerlessPlugin(mockServerless, mockOptions);
|
|
281
|
-
|
|
281
|
+
|
|
282
282
|
const consoleLogSpy = jest.spyOn(console, 'log').mockImplementation();
|
|
283
283
|
|
|
284
284
|
plugin.beforeDeploy();
|
|
@@ -292,7 +292,7 @@ describe('FriggServerlessPlugin', () => {
|
|
|
292
292
|
describe('Error Handling', () => {
|
|
293
293
|
it('should handle fs.mkdirSync errors gracefully', async () => {
|
|
294
294
|
plugin = new FriggServerlessPlugin(mockServerless, mockOptions);
|
|
295
|
-
|
|
295
|
+
|
|
296
296
|
fs.existsSync.mockReturnValue(false);
|
|
297
297
|
fs.mkdirSync.mockImplementation(() => {
|
|
298
298
|
throw new Error('Permission denied');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@friggframework/serverless-plugin",
|
|
3
|
-
"version": "2.0.0--canary.461.
|
|
3
|
+
"version": "2.0.0--canary.461.e679ea5.0",
|
|
4
4
|
"description": "Plugin to help dynamically load frigg resources",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -11,5 +11,5 @@
|
|
|
11
11
|
"publishConfig": {
|
|
12
12
|
"access": "public"
|
|
13
13
|
},
|
|
14
|
-
"gitHead": "
|
|
14
|
+
"gitHead": "e679ea5502f29133d25b93b6f5b36f9b3099f82c"
|
|
15
15
|
}
|