What is the primary testing framework used for unit testing in NestJS?
Jasmine
Jest
Mocha
Chai
In JWT authentication, what does JWT stand for?
Just Write Tests
JSON Web Token
JavaScript Web Token
Java Web Token
What decorator is used to register a caching interceptor globally in a NestJS application?
@Cache()
@UseInterceptors(CacheInterceptor)
@GlobalCache()
@GlobalInterceptor(CacheInterceptor)
How can you apply a transformation interceptor to a specific method in a controller in NestJS?
By using the @UseInterceptors() decorator at the method level
@UseInterceptors()
By extending the BaseController class and applying the interceptor in the constructor
BaseController
By registering the interceptor globally in the app.module.ts file
app.module.ts
By using the @Transform() decorator above the controller class
@Transform()
What is the role of a 'Guard' in the context of NestJS authentication?
Defining API routes
Validating incoming requests and verifying user authentication
Storing user credentials
Encrypting sensitive data
What is the primary advantage of using Mongoose with NestJS for database integration?
Mongoose provides a schema-based solution for modeling data in MongoDB
Mongoose automatically generates frontend UI components
Mongoose is used for managing relational databases in NestJS
Mongoose enables direct execution of SQL queries on MongoDB
How do you activate a custom Guard globally in a NestJS application?
By manually adding the guard to each route handler where it's needed.
By using the @Global() decorator before the guard class definition.
@Global()
By defining the guard within the main.ts file of your application.
main.ts
By registering the guard in the providers array of the module where it's defined.
providers
How does the CQRS pattern improve the design of event-driven systems?
By enforcing synchronous communication between components
By separating read and write operations for better performance and scalability
By simplifying the handling of complex events
By eliminating the need for event listeners
What is the purpose of the 'ParseIntPipe' in NestJS?
To transform a numeric string into an integer.
To convert a string value to a Boolean.
To validate the data type of an input parameter.
To parse an object into a JSON string.
How does NestJS support the implementation of query handlers in a CQRS system?
Through dedicated decorators for defining query handlers
By integrating with GraphQL for efficient query resolution
Query handlers are not directly supported, they are typically implemented as service methods
By providing built-in classes for handling database queries