Example #1
0
 .then(() => {
     assert(result() === "OVERWRITTEN");
 })
Example #2
0
 it('next week', function () {
   var result = formatRelative(new Date(1986, 3 /* Apr */, 6, 12, 0), baseDate, {locale: locale})
   assert(result === 'Sunday at 12:00 p.m.')
 })
Example #3
0
 it('Mo', function () {
   var result = format(date, 'Mo [month]', {locale: locale})
   assert(result === '4th month')
 })
Example #4
0
 it('last week', function () {
   var result = formatRelative(new Date(1986, 3 /* Apr */, 1), baseDate, {locale: locale})
   assert(result === 'last Tuesday at 12:00 a.m.')
 })
Example #5
0
 it('today', function () {
   var result = formatRelative(new Date(1986, 3 /* Apr */, 4, 16, 50), baseDate, {locale: locale})
   assert(result === 'today at 4:50 p.m.')
 })
Example #6
0
 it('LTS', function () {
   var result = format(date, 'LTS', {locale: locale})
   assert(result === '10:32:00 a.m.')
 })
Example #7
0
 it('LL', function () {
   var result = format(date, 'LL', {locale: locale})
   assert(result === 'April 4 1986')
 })
Example #8
0
 .then(() => {
     assert(result() === "a" || result() === "ab" || result() === "ba")
 })
Example #9
0
 () => {
     assert(false, "should fail")
 },
Example #10
0
 it('returns `Invalid Date` if the given date is invalid', function () {
   var result = startOfHour(new Date(NaN))
   assert(result instanceof Date && isNaN(result))
 })
Example #11
0
 .then(() => {
     assert(result() === "aaaa")
 })
Example #12
0
 vm.$resetValidation(() => {
   assert(vm.$validator1.field1.required === false)
   assert(vm.$validator1.field1.min === false)
   assert(vm.$validator1.field1.max === true)
   assert(vm.$validator1.field1.valid === false)
   assert(vm.$validator1.field1.dirty === false)
   assert(vm.$validator1.field1.modified === false)
   assert(vm.$validator1.field1.touched === false)
   assert(vm.$validator1.field2.minlength === true)
   assert(vm.$validator1.field2.valid === false)
   assert(vm.$validator1.field2.dirty === false)
   assert(vm.$validator1.field2.modified === false)
   assert(vm.$validator1.field2.touched === false)
   assert(vm.$validator1.valid === false)
   assert(vm.$validator1.dirty === false)
   assert(vm.$validator1.modified === false)
   assert(vm.$validator1.touched === false)
   
   done()
 })
Example #13
0
    it('should be reset', (done) => {
      assert(vm.$validator1.field1.required)
      assert(vm.$validator1.field1.min === false)
      assert(vm.$validator1.field1.max === false)
      assert(vm.$validator1.field1.valid === false)
      assert(vm.$validator1.field1.dirty === false)
      assert(vm.$validator1.field1.modified === false)
      assert(vm.$validator1.field1.touched === false)
      assert(vm.$validator1.field2.minlength === false)
      assert(vm.$validator1.field2.valid === true)
      assert(vm.$validator1.field2.dirty === false)
      assert(vm.$validator1.field2.modified === false)
      assert(vm.$validator1.field2.touched === false)
      assert(vm.$validator1.valid === false)
      assert(vm.$validator1.dirty === false)
      assert(vm.$validator1.modified === false)
      assert(vm.$validator1.touched === false)

      let field1 = el.getElementsByTagName('input')[0]
      let field2 = el.getElementsByTagName('input')[1]
      field1.value = '11'
      field2.value = 'hi'
      trigger(field1, 'input')
      trigger(field1, 'blur')
      trigger(field2, 'input')
      trigger(field2, 'blur')
      vm.$nextTick(() => {
        vm.$resetValidation(() => {
          assert(vm.$validator1.field1.required === false)
          assert(vm.$validator1.field1.min === false)
          assert(vm.$validator1.field1.max === true)
          assert(vm.$validator1.field1.valid === false)
          assert(vm.$validator1.field1.dirty === false)
          assert(vm.$validator1.field1.modified === false)
          assert(vm.$validator1.field1.touched === false)
          assert(vm.$validator1.field2.minlength === true)
          assert(vm.$validator1.field2.valid === false)
          assert(vm.$validator1.field2.dirty === false)
          assert(vm.$validator1.field2.modified === false)
          assert(vm.$validator1.field2.touched === false)
          assert(vm.$validator1.valid === false)
          assert(vm.$validator1.dirty === false)
          assert(vm.$validator1.modified === false)
          assert(vm.$validator1.touched === false)
          
          done()
        })
      })
    })
Example #14
0
    it('should be reset', (done) => {
      // default
      assert(vm.$validator1.field1.required === false)
      assert(vm.$validator1.field1.valid === true)
      assert(vm.$validator1.field1.touched === false)
      assert(vm.$validator1.field1.dirty === false)
      assert(vm.$validator1.field1.modified === false)
      assert(vm.$validator1.field2.required)
      assert(vm.$validator1.field2.valid === false)
      assert(vm.$validator1.field2.touched === false)
      assert(vm.$validator1.field2.dirty === false)
      assert(vm.$validator1.field2.modified === false)
      assert(vm.$validator1.valid === false)
      assert(vm.$validator1.touched === false)
      assert(vm.$validator1.dirty === false)
      assert(vm.$validator1.modified === false)

      // change
      let radio2 = el.getElementsByTagName('input')[1]
      let radio3 = el.getElementsByTagName('input')[2]
      radio2.checked = true
      radio3.checked = true
      trigger(radio2, 'change')
      trigger(radio2, 'blur')
      trigger(radio3, 'change')
      trigger(radio3, 'blur')
      vm.$nextTick(() => {
        vm.$resetValidation(() => {
          assert(vm.$validator1.field1.required === false)
          assert(vm.$validator1.field1.valid === true)
          assert(vm.$validator1.field1.touched === false)
          assert(vm.$validator1.field1.dirty === false)
          assert(vm.$validator1.field1.modified === false)
          assert(vm.$validator1.field2.required === false)
          assert(vm.$validator1.field2.valid === true)
          assert(vm.$validator1.field2.touched === false)
          assert(vm.$validator1.field2.dirty === false)
          assert(vm.$validator1.field2.modified === false)
          assert(vm.$validator1.valid === true)
          assert(vm.$validator1.touched === false)
          assert(vm.$validator1.dirty === false)
          assert(vm.$validator1.modified === false)

          done()
        })
      })
    })
Example #15
0
 it('12 a.m.', function () {
   var date = new Date(1986, 3 /* Apr */, 6, 0, 0, 0, 900)
   var result = format(date, 'h:mm aa', {locale: locale})
   assert(result === '12:00 a.m.')
 })
Example #16
0
 () => {
     assert(result() == null || result() === "a")
 }
Example #17
0
 it('12PM', function () {
   var date = new Date(1986, 3 /* Apr */, 4, 12, 0, 0, 900)
   var result = format(date, 'hh:mmA', {locale: locale})
   assert(result === '12:00PM')
 })
Example #18
0
 it('field scope should not be assigned', () => {
   assert(vm.$validator1.field1 === undefined)
 })
Example #19
0
 it('L', function () {
   var result = format(new Date(2017, 6 /* Jul */, 2), 'L', {locale: locale})
   assert(result === '07/02/2017')
 })
Example #20
0
 frontnote.render('./test/sass/*.scss',function() {
     for (var i = 0, len = noAssertFiles.length; i < len; i++) {
         assert(fs.existsSync(files[i]) === true);
     }
     done();
 });
Example #21
0
 it('LLLL', function () {
   var result = format(date, 'LLLL', {locale: locale})
   assert(result === 'Friday, April 4 1986 10:32 a.m.')
 })
Example #22
0
 it('returns NaN if the both dates are `Invalid Date`', function() {
   var result = differenceInWeeks(new Date(NaN), new Date(NaN))
   assert(isNaN(result))
 })
Example #23
0
 it('yesterday', function () {
   var result = formatRelative(new Date(1986, 3 /* Apr */, 3, 22, 22), baseDate, {locale: locale})
   assert(result === 'yesterday at 10:22 p.m.')
 })
Example #24
0
 cli.fetch(helper.url('~mega'), function (err, $, res, body) {
   assert(! err);
   assert(body.length === 1024 * 1024);
   done();
 });
Example #25
0
 it('tomorrow', function () {
   var result = formatRelative(new Date(1986, 3 /* Apr */, 5, 7, 30), baseDate, {locale: locale})
   assert(result === 'tomorrow at 7:30 a.m.')
 })
      textlint.lintMarkdown('この文章は不適切な文字xxxを含みます。').then(result => {

        assert(result.messages.length === 1);
        assert(result.messages[0].message === 'Document contains NG word "xxx".');

      }).then(done, done);
Example #27
0
 it('after the next week', function () {
   var result = formatRelative(new Date(1986, 3 /* Apr */, 11, 16, 50), baseDate, {locale: locale})
   assert(result === '04/11/1986')
 })
      textlint.lintMarkdown('この文章は不適切な表現を含みません。').then(result => {

        assert(result.messages.length === 0);

      }).then(done, done);
Example #29
0
 it('MMMM', function () {
   var result = format(date, 'MMMM', {locale: locale})
   assert(result === 'April')
 })
Example #30
0
 .then(() => {
     assert(result() === "1\n2\n3");
 })