Change signature of customFields and make ListenerRSSInfos properties ro
This commit is contained in:
		@@ -25,10 +25,10 @@ describe("test class RSS: jsonfile", function () {
 | 
			
		||||
    name: "my-test-service",
 | 
			
		||||
    address: "fake.rss.service",
 | 
			
		||||
    timeloop: 15,
 | 
			
		||||
    customfields: [
 | 
			
		||||
      ["description", ["media:group", "media:description"]],
 | 
			
		||||
      ["icon", ["media:group", "media:thumbnail"]],
 | 
			
		||||
    ],
 | 
			
		||||
    customfields: {
 | 
			
		||||
      description: ["media:group", "media:description"],
 | 
			
		||||
      icon: ["media:group", "media:thumbnail"],
 | 
			
		||||
    },
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  // parseURL tests
 | 
			
		||||
@@ -101,10 +101,10 @@ describe("test class RSS: jsonfile", function () {
 | 
			
		||||
      expect(myListener.timeloop).to.eql(15);
 | 
			
		||||
      expect(myListener.name).to.eql("my-test-service");
 | 
			
		||||
      expect(myListener.address).to.eql("fake.rss.service");
 | 
			
		||||
      expect(myListener.customfields).to.eql([
 | 
			
		||||
        ["description", ["media:group", "media:description"]],
 | 
			
		||||
        ["icon", ["media:group", "media:thumbnail"]],
 | 
			
		||||
      ]);
 | 
			
		||||
      expect(myListener.customfields).to.eql({
 | 
			
		||||
        description: ["media:group", "media:description"],
 | 
			
		||||
        icon: ["media:group", "media:thumbnail"],
 | 
			
		||||
      });
 | 
			
		||||
      /* // TODO test des champs dans l'objet parser
 | 
			
		||||
      expect(myListener.parser.options.customFields).to.eql({
 | 
			
		||||
        feed: [],
 | 
			
		||||
@@ -112,20 +112,18 @@ describe("test class RSS: jsonfile", function () {
 | 
			
		||||
      });*/
 | 
			
		||||
    });
 | 
			
		||||
    // it("The build without issues (raw infos : 4 params)", function () {
 | 
			
		||||
    //   myListener = new Listeners("my-test-service", "fake.rss.service", 15, [
 | 
			
		||||
    //     ["description", ["media:group", "media:description"]],
 | 
			
		||||
    //     ["icon", ["media:group", "media:thumbnail"]],
 | 
			
		||||
    //   ]);
 | 
			
		||||
    //   myListener = new Listeners("my-test-service", "fake.rss.service", 15, { //     description: ["media:group", "media:description"],
 | 
			
		||||
    //     icon: ["media:group", "media:thumbnail"],
 | 
			
		||||
    // });
 | 
			
		||||
    //
 | 
			
		||||
    //   // assertions
 | 
			
		||||
    //   // myListener data
 | 
			
		||||
    //   expect(myListener.timeloop).to.eql(15);
 | 
			
		||||
    //   expect(myListener.name).to.eql("my-test-service");
 | 
			
		||||
    //   expect(myListener.address).to.eql("fake.rss.service");
 | 
			
		||||
    //   expect(myListener.customfields).to.eql([
 | 
			
		||||
    //     ["description", ["media:group", "media:description"]],
 | 
			
		||||
    //     ["icon", ["media:group", "media:thumbnail"]],
 | 
			
		||||
    //   ]);
 | 
			
		||||
    //   expect(myListener.customfields).to.eql({ //     description: ["media:group", "media:description"],
 | 
			
		||||
    //     icon: ["media:group", "media:thumbnail"],
 | 
			
		||||
    // });
 | 
			
		||||
    //   /*
 | 
			
		||||
    //   expect(myListener.parser.options.customFields).to.eql({
 | 
			
		||||
    //     feed: [],
 | 
			
		||||
@@ -167,10 +165,9 @@ describe("test class RSS: jsonfile", function () {
 | 
			
		||||
    //     "my-test-service",
 | 
			
		||||
    //     "fake.rss.service",
 | 
			
		||||
    //     undefined,
 | 
			
		||||
    //     [
 | 
			
		||||
    //       ["description", ["media:group", "media:description"]],
 | 
			
		||||
    //       ["icon", ["media:group", "media:thumbnail"]],
 | 
			
		||||
    //     ]
 | 
			
		||||
    //     { //       description: ["media:group", "media:description"],
 | 
			
		||||
    //       icon: ["media:group", "media:thumbnail"],
 | 
			
		||||
    // }
 | 
			
		||||
    //   );
 | 
			
		||||
    //
 | 
			
		||||
    //   // assertions
 | 
			
		||||
@@ -218,10 +215,10 @@ describe("test class RSS: jsonfile", function () {
 | 
			
		||||
      myListener = new Listeners({
 | 
			
		||||
        name: "my-test-service",
 | 
			
		||||
        address: "bad.rss.service",
 | 
			
		||||
        customfields: [
 | 
			
		||||
          ["description", ["media:group", "media:description"]],
 | 
			
		||||
          ["icon", ["media:group", "media:thumbnail"]],
 | 
			
		||||
        ],
 | 
			
		||||
        customfields: {
 | 
			
		||||
          description: ["media:group", "media:description"],
 | 
			
		||||
          icon: ["media:group", "media:thumbnail"],
 | 
			
		||||
        },
 | 
			
		||||
      });
 | 
			
		||||
      myListener.parser = stubParser; // replace the parser by my fake parser
 | 
			
		||||
      // fetch
 | 
			
		||||
@@ -249,10 +246,10 @@ describe("test class RSS: jsonfile", function () {
 | 
			
		||||
        name: "my-test-service",
 | 
			
		||||
        address: "fake.rss.service",
 | 
			
		||||
        timeloop: 2,
 | 
			
		||||
        customfields: [
 | 
			
		||||
          ["description", ["media:group", "media:description"]],
 | 
			
		||||
          ["icon", ["media:group", "media:thumbnail"]],
 | 
			
		||||
        ],
 | 
			
		||||
        customfields: {
 | 
			
		||||
          description: ["media:group", "media:description"],
 | 
			
		||||
          icon: ["media:group", "media:thumbnail"],
 | 
			
		||||
        },
 | 
			
		||||
      });
 | 
			
		||||
 | 
			
		||||
      //spy
 | 
			
		||||
@@ -280,10 +277,10 @@ describe("test class RSS: jsonfile", function () {
 | 
			
		||||
        name: "my-test-service",
 | 
			
		||||
        address: "fake.rss.service",
 | 
			
		||||
        timeloop: 2,
 | 
			
		||||
        customfields: [
 | 
			
		||||
          ["description", ["media:group", "media:description"]],
 | 
			
		||||
          ["icon", ["media:group", "media:thumbnail"]],
 | 
			
		||||
        ],
 | 
			
		||||
        customfields: {
 | 
			
		||||
          description: ["media:group", "media:description"],
 | 
			
		||||
          icon: ["media:group", "media:thumbnail"],
 | 
			
		||||
        },
 | 
			
		||||
      });
 | 
			
		||||
 | 
			
		||||
      //spy
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user