项目原始demo,不改动
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
 
 
 
 

19 rivejä
618 B

  1. tools = require '../src/tools'
  2. describe "tools", ->
  3. describe "quote()", ->
  4. it "should convert html special strings to their entities", ->
  5. tools.quote(" abc<>\"\n")
  6. .should.equal '&sp;abc&lt;&gt;&quot;<br />'
  7. describe "stringToDom()", ->
  8. it "should work", ->
  9. tools.stringToDom('<a> text<a1>text</a1> text <a2>text</a2><a3>text</a3>text</a>text')
  10. describe "objectToDom()", ->
  11. it "should work", ->
  12. tools.objectToDom({a: 'text'})
  13. it "should have quoted text nodes", ->
  14. tools.objectToDom({a: '&<> "'})[0].children[0]
  15. .data.should.equal '&amp;&lt;&gt;&sp;&quot;'