Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-13945

`npm test` still relevant?

    XMLWordPrintableJSON

Details

    • Task
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • cordova-docs
    • None

    Description

      There are some tests in cordova-docs which can be run with `npm test`, described here: https://github.com/apache/cordova-docs/blob/master/doc/testing-the-website.md

      C:\Projects\Cordova\cordova-docs (janpio-random_docs_stuff -> origin) (cordova-website@0.0.1)
      λ npm test
      
      > cordova-website@0.0.1 test C:\Projects\Cordova\cordova-docs
      > npm run eslint && npm run mocha
      
      
      > cordova-website@0.0.1 eslint C:\Projects\Cordova\cordova-docs
      > eslint tools/lib tools/spec
      
      
      > cordova-website@0.0.1 mocha C:\Projects\Cordova\cordova-docs
      > mocha --recursive tools/spec
      
      (node:11372) [DEP0006] DeprecationWarning: child_process: options.customFds option is deprecated. Use options.stdio instead.
      
      
        AddTitle
          √ should set the title
          √ should skip files with no source title
          √ should skip files with no target title
      
        Prettify
          √ should find some code blocks
          √ should add the prettyprint class to each code block
      
        TableOfContents
          √ should find the table of content values
          √ should find all <h1> elements
          √ should find all <h2> elements
          √ should ignore whitespace in the target name
          √ should create a HTML select element
          √ should skip files with no source title
          √ should skip files with no target title
      
        UpdateIndex
          √ should skip all files but index.md.html
          √ should rename the title
          √ should rename the file
      
        UpdateKeywordIndex
          √ should skip all files but _index.html
          √ should rename the title
          √ should rename the h1 (66ms)
          √ should remove the <hr/>
          √ should update references from index.md.html to index.html
      
        YamlFrontMatter
          √ should skip files with no YAML Front Matter
          √ should parse files with YAML Front Matter
      
        FileHelpers
          - should have a default input directory that exists
      
      
        22 passing (901ms)
        1 pending
      
      

      If you follow the trail, this seems to run the tests in `tools/spec/cordova`. Looking into the actual spec files, it seems to test functionality in these files:

      • /lib/cordova/post/addtitle
      • /lib/cordova/post/prettify
      • /lib/cordova/post/tableofcontents
      • /lib/cordova/post/updateindex
      • /lib/cordova/post/updatekeywordindex
      • /lib/cordova/pre/yamlfrontmatter

      Is the code being tested here actually still relevant for the current state of the docs?

      Attachments

        Activity

          People

            Unassigned Unassigned
            Sujan12 Jan Piotrowski (janpio)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: