Commit a45ef030 authored by Rene Saarsoo's avatar Rene Saarsoo
Browse files

Detect doc-comment when not followed by SCSS code.

parent 52db36dc
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -44,6 +44,15 @@ module JsDuck

          find_doc_comments(node.children)
        end

        if prev_comment
          @docs << {
            :comment => prev_comment.value[0],
            :linenr => prev_comment.line,
            :code => {:tagname => :property},
            :type => :doc_comment,
          }
        end
      end

      def analyze_code(node)
+16 −0
Original line number Diff line number Diff line
@@ -152,4 +152,20 @@ describe JsDuck::Css::SassParser do
    end
  end

  describe "parsing doc-comment without any SCSS code afterwards" do
    let(:docs) do
      parse(<<-EOCSS)
        /** My docs */
      EOCSS
    end

    it "detects one docset" do
      docs.length.should == 1
    end

    it "detects code as :property" do
      docs[0][:code][:tagname].should == :property
    end
  end

end