If you filed an application for naturalization using the 3-year rule based on marriage to a US citizen and before you take the oath, if at any stage there is a divorce, it does not mean that your application is going to be denied. This is how it works. Except for a small group, most applicants do not file the paperwork as soon as they are technically eligible. Months pass by after someone is eligible before people find the time to put together all the supporting evidence and they come around to finding an attorney to help with the paperwork or do it themselves. If there are delays at the USCIS, it could be months before you get invited to the interview. If your name gets stuck in the background check, months may fly by. So it could very well be that by the time you get to the interview stage, you are eligible under the 5-year rule.
So what is the best course of action? If you applied right on time and your application is proceeding rapidly, it is unlikely that you will be able to use the 5-year rule (the idea is that you should have met the 3- or 5-year rule on the day of oath for citizenship). In that case, it is best to withdraw your application and simply wait till you are eligible under the five-year rule.
On the other hand, if you are about to be eligible under the five-year rule (use the option to delay your interview if this will buy you more time), then show up for the interview. During the interview the officer will ask you if any piece of information in your application has changed. If the divorce is finalized, provide a copy of the documentation. If the divorce is ongoing, let the officer know about this. The interviewing officer is very smart and is aware of all the rules that apply to you. Also, they genuinely want to help people, so if you are eligible under the five-year rule, most likely you will be approved because the officer will exercise his discretion in the matter. The chance of denial are minimal, but even if that were to happen, wait for instructions from the officer and USCIS, because it could very well be that you may not need to file all the paperwork again and pay the fees, and might merely be asked to wait for a decision later on in the mail after you have reached the five-year eligibility date.