summaryrefslogtreecommitdiff
path: root/spec/unit/js/yarn_lock_spec.rb
blob: 794aa4c1b1d09810b53a0c6e66dc3269958c1fd4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# frozen_string_literal: true

RSpec.describe Spandx::Js::YarnLock do
  subject { described_class.new(fixture_file('js/yarn.lock')) }

  describe '#each' do
    let(:items) { [] }

    before do
      subject.each do |item|
        items << item
      end
    end

    specify { expect(items).not_to be_empty }
    specify { expect(items.map { |x| x['name'] }).to include('@types/node') }
    specify { expect(items.map { |x| x['name'] }).to include('@babel/core') }
  end
end