1. /**
    
  2.  * Copyright (c) Meta Platforms, Inc. and affiliates.
    
  3.  *
    
  4.  * This source code is licensed under the MIT license found in the
    
  5.  * LICENSE file in the root directory of this source tree.
    
  6.  *
    
  7.  * @emails react-core
    
  8.  */
    
  9. 
    
  10. 'use strict';
    
  11. 
    
  12. const rule = require('../no-to-warn-dev-within-to-throw');
    
  13. const {RuleTester} = require('eslint');
    
  14. const ruleTester = new RuleTester();
    
  15. 
    
  16. ruleTester.run('eslint-rules/no-to-warn-dev-within-to-throw', rule, {
    
  17.   valid: [
    
  18.     'expect(callback).toWarnDev("warning");',
    
  19.     'expect(function() { expect(callback).toThrow("error") }).toWarnDev("warning");',
    
  20.   ],
    
  21.   invalid: [
    
  22.     {
    
  23.       code: 'expect(function() { expect(callback).toWarnDev("warning") }).toThrow("error");',
    
  24.       errors: [
    
  25.         {
    
  26.           message: 'toWarnDev() matcher should not be nested',
    
  27.         },
    
  28.       ],
    
  29.     },
    
  30.   ],
    
  31. });