e22m4u 2 недель назад
Родитель
Сommit
2c163bd104
1 измененных файлов с 12 добавлено и 12 удалено
  1. 12 12
      src/route/route.spec.js

+ 12 - 12
src/route/route.spec.js

@@ -138,7 +138,7 @@ describe('Route', function () {
     });
     });
 
 
     describe('the "preHandler" option', function () {
     describe('the "preHandler" option', function () {
-      it('should require the "preHandler" option to be a Function or an Array of Function', function () {
+      it('should require the "preHandler" option to be a Function or an Array', function () {
         const throwable = v => () =>
         const throwable = v => () =>
           new Route({
           new Route({
             method: HttpMethod.GET,
             method: HttpMethod.GET,
@@ -165,7 +165,7 @@ describe('Route', function () {
         throwable(undefined)();
         throwable(undefined)();
       });
       });
 
 
-      it('should require an array of the "preHandler" option to contain a Function', function () {
+      it('should require each element in the "preHandler" option to be a Function', function () {
         const throwable = v => () =>
         const throwable = v => () =>
           new Route({
           new Route({
             method: HttpMethod.GET,
             method: HttpMethod.GET,
@@ -188,7 +188,7 @@ describe('Route', function () {
         throwable(() => undefined)();
         throwable(() => undefined)();
       });
       });
 
 
-      it('should add a Function to "preHandler" hooks', function () {
+      it('should add a single Function from the "preHandler" option to the "preHandler" hooks', function () {
         const value = () => undefined;
         const value = () => undefined;
         const route = new Route({
         const route = new Route({
           method: HttpMethod.GET,
           method: HttpMethod.GET,
@@ -201,7 +201,7 @@ describe('Route', function () {
         expect(res).to.be.true;
         expect(res).to.be.true;
       });
       });
 
 
-      it('should add a Function Array to "preHandler" hooks', function () {
+      it('should add each Function from the "preHandler" option to the "preHandler" hooks', function () {
         const value = [() => undefined, () => undefined];
         const value = [() => undefined, () => undefined];
         const route = new Route({
         const route = new Route({
           method: HttpMethod.GET,
           method: HttpMethod.GET,
@@ -218,7 +218,7 @@ describe('Route', function () {
     });
     });
 
 
     describe('the "postHandler" option', function () {
     describe('the "postHandler" option', function () {
-      it('should require the "postHandler" option to be a Function or an Array of Function', function () {
+      it('should require the "postHandler" option to be a Function or an Array', function () {
         const throwable = v => () =>
         const throwable = v => () =>
           new Route({
           new Route({
             method: HttpMethod.GET,
             method: HttpMethod.GET,
@@ -245,7 +245,7 @@ describe('Route', function () {
         throwable(undefined)();
         throwable(undefined)();
       });
       });
 
 
-      it('should require an array of the "postHandler" option to contain a Function', function () {
+      it('should require each element in the "postHandler" option to be a Function', function () {
         const throwable = v => () =>
         const throwable = v => () =>
           new Route({
           new Route({
             method: HttpMethod.GET,
             method: HttpMethod.GET,
@@ -268,7 +268,7 @@ describe('Route', function () {
         throwable(() => undefined)();
         throwable(() => undefined)();
       });
       });
 
 
-      it('should add a Function to "postHandler" hooks', function () {
+      it('should add a single Function from the "postHandler" option to the "postHandler" hooks', function () {
         const value = () => undefined;
         const value = () => undefined;
         const route = new Route({
         const route = new Route({
           method: HttpMethod.GET,
           method: HttpMethod.GET,
@@ -281,7 +281,7 @@ describe('Route', function () {
         expect(res).to.be.true;
         expect(res).to.be.true;
       });
       });
 
 
-      it('should add a Function Array to "postHandler" hooks', function () {
+      it('should add each Function from the "postHandler" option to the "postHandler" hooks', function () {
         const value = [() => undefined, () => undefined];
         const value = [() => undefined, () => undefined];
         const route = new Route({
         const route = new Route({
           method: HttpMethod.GET,
           method: HttpMethod.GET,
@@ -322,7 +322,7 @@ describe('Route', function () {
         throwable(undefined)();
         throwable(undefined)();
       });
       });
 
 
-      it('should set the "meta" option to the "meta" property as a deep copy', function () {
+      it('should deeply copy the "meta" option to the "meta" property', function () {
         const metaData = {foo: {bar: {baz: 'qux'}}};
         const metaData = {foo: {bar: {baz: 'qux'}}};
         const route = new Route({
         const route = new Route({
           method: 'post',
           method: 'post',
@@ -338,7 +338,7 @@ describe('Route', function () {
         expect(route.meta.foo.bar).to.be.eql(metaData.foo.bar);
         expect(route.meta.foo.bar).to.be.eql(metaData.foo.bar);
       });
       });
 
 
-      it('should set an empty object to the "meta" property if the "meta" option is not provided', function () {
+      it('should set an empty object to the "meta" property if not provided', function () {
         const route = new Route({
         const route = new Route({
           method: 'post',
           method: 'post',
           path: ROOT_PATH,
           path: ROOT_PATH,
@@ -347,7 +347,7 @@ describe('Route', function () {
         expect(route.meta).to.be.eql({});
         expect(route.meta).to.be.eql({});
       });
       });
 
 
-      it('should set an empty object to the "meta" property if the "meta" option is undefined', function () {
+      it('should set an empty object to the "meta" property if undefined is given', function () {
         const route = new Route({
         const route = new Route({
           method: 'post',
           method: 'post',
           path: ROOT_PATH,
           path: ROOT_PATH,
@@ -360,7 +360,7 @@ describe('Route', function () {
   });
   });
 
 
   describe('getDefinition', function () {
   describe('getDefinition', function () {
-    it('should return a route definition that was provided to the constructor', function () {
+    it('should return the same HookRegistry instance on subsequent calls', function () {
       const definition = {
       const definition = {
         method: HttpMethod.GET,
         method: HttpMethod.GET,
         path: '/myPath',
         path: '/myPath',