コード例 #1
0
ファイル: utils_spec.js プロジェクト: indexexchange/Prebid.js
    it('should replace all given tokens in a String', function () {
      var tokensToReplace = {
        foo: 'bar',
        zap: 'quux'
      };

      var output = utils.replaceTokenInString('hello %FOO%, I am %ZAP%', tokensToReplace, '%');
      assert.equal(output, 'hello bar, I am quux');
    });
コード例 #2
0
ファイル: utils_spec.js プロジェクト: indexexchange/Prebid.js
    it('should ignore tokens it does not see', function () {
      var output = utils.replaceTokenInString('hello %FOO%', {}, '%');

      assert.equal(output, 'hello %FOO%');
    });