Skip to content

Consider changing this to return a proper error status code #17

@github-actions

Description

@github-actions

// @TODO: Consider changing this to return a proper error status code

			});
		});

		it('should handle a non-existing template request', function(done) {
			Blast.fetch(url + '?view=does_not_exist_at_all', function gotResponse(err, res, body) {
				// Currently, a non-existing template returns a 200 status code with a fallback view.
				// This is arguably incorrect behavior - ideally it should return 404 or 500.
				// However, for now we document and test the current behavior.
				// @TODO: Consider changing this to return a proper error status code
				
				// The request should complete without error
				assert.strictEqual(!!err, false, 'Request should complete without error');
				
				// Currently returns 200 (documenting existing behavior)
				assert.strictEqual(res.statusCode, 200, 
					'Currently returns 200 for missing template (known limitation)');
				
				done();
			});
		});

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions