Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

busted before_each and after_each #50

Merged
merged 1 commit into from
Feb 9, 2021

Conversation

Conni2461
Copy link
Collaborator

@Conni2461 Conni2461 commented Jan 16, 2021

Just a sketch. I probably need to do something a little smarter. But i am tired right now, so i will finish it tomorrow :)

Edit: after_each could also be helpful. Any thoughts tj? Or whats suggested here: #49 (comment)

Thats the idea, because tami asked 😆 :

describe('main', function()
  it('stuff 0', function() end) -- will not run any before_each
  describe('nested', function()
    before_each(clear)
    it('stuff 1', function() end) -- will run clear
    describe('nested nested', function()
      before_each(del_db)
      it('stuff 2', function() end) -- will run clear and del_db
    end)
    it('stuff 3', function() end) -- will run clear
  end)
  it('stuff 4', function() end) -- will not run any before_each
end)

Comment on lines +166 to +175
mod.clear = function()
vim.api.nvim_buf_set_lines(0, 0, -1, false, {})
end
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do we need to clear?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Later we can do something like:

Go through all the buffers, delete them, etc.

@Conni2461 Conni2461 force-pushed the busted_before_each branch 3 times, most recently from c897ab6 to b938ea2 Compare January 17, 2021 19:13
@Conni2461 Conni2461 changed the title WIP: before_each busted before_each and after_each Jan 17, 2021
@Conni2461 Conni2461 mentioned this pull request Jan 18, 2021
@tjdevries tjdevries merged commit 0ebdbf3 into nvim-lua:master Feb 9, 2021
@Conni2461 Conni2461 deleted the busted_before_each branch February 9, 2021 19:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants